```
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "ci/ciCallSite.hpp"
27 #include "ci/ciInstance.hpp"
28 #include "ci/ciInstanceKlass.hpp"
29 #include "ci/ciMemberName.hpp"
30 #include "ci/ciMethod.hpp"
31 #include "ci/ciMethodData.hpp"
32 #include "ci/ciMethodHandle.hpp"
33 #include "ci/ciMethodType.hpp"
34 #include "ci/ciNullObject.hpp"
35 #include "ci/ciObjArray.hpp"
36 #include "ci/ciObjArrayKlass.hpp"
37 #include "ci/ciObject.hpp"
38 #include "ci/ciObjectFactory.hpp"
39 #include "ci/ciSymbol.hpp"
40 #include "ci/ciTypeArray.hpp"
41 #include "ci/ciTypeArrayKlass.hpp"
42 #include "ci/ciUtilities.hpp"
43 #include "classfile/javaClasses.inline.hpp"
44 #include "classfile/systemDictionary.hpp"
45 #include "gc/shared/collectedHeap.inline.hpp"
46 #include "memory/allocation.inline.hpp"
47 #include "oops/oop.inline.hpp"
48 #include "runtime/fieldType.hpp"
49 #include "utilities/macros.hpp"
50
51 // ciObjectFactory
52 //
53 // This class handles requests for the creation of new instances
54 // of ciObject and its subclasses. It contains a caching mechanism
55 // which ensures that for each oop, at most one ciObject is created.
56 // This invariant allows more efficient implementation of ciObject.
57 //
58 // Implementation note: the oop->ciObject mapping is represented as
59 // a table stored in an array. Even though objects are moved
60 // by the garbage collector, the compactor preserves their relative
61 // order; address comparison of oops (in perm space) is safe so long
62 // as we prohibit GC during our comparisons. We currently use binary
63 // search to find the oop in the table, and inserting a new oop
64 // into the table may be costly. If this cost ends up being
65 // problematic the underlying data structure can be switched to some
66 // sort of balanced binary tree.
67
68 GrowableArray<ciMetadata*>* ciObjectFactory::_shared_ci_metadata = NULL;
``` | 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "ci/ciCallSite.hpp" 27 #include "ci/ciInstance.hpp" 28 #include "ci/ciInstanceKlass.hpp" 29 #include "ci/ciMemberName.hpp" 30 #include "ci/ciMethod.hpp" 31 #include "ci/ciMethodData.hpp" 32 #include "ci/ciMethodHandle.hpp" 33 #include "ci/ciMethodType.hpp" 34 #include "ci/ciNullObject.hpp" 35 #include "ci/ciObjArray.hpp" 36 #include "ci/ciObjArrayKlass.hpp" 37 #include "ci/ciObject.hpp" 38 #include "ci/ciObjectFactory.hpp" 39 #include "ci/ciSymbol.hpp" 40 #include "ci/ciTypeArray.hpp" 41 #include "ci/ciTypeArrayKlass.hpp" 42 #include "ci/ciUtilities.inline.hpp" 43 #include "classfile/javaClasses.inline.hpp" 44 #include "classfile/systemDictionary.hpp" 45 #include "gc/shared/collectedHeap.inline.hpp" 46 #include "memory/allocation.inline.hpp" 47 #include "oops/oop.inline.hpp" 48 #include "runtime/fieldType.hpp" 49 #include "runtime/handles.inline.hpp" 50 #include "utilities/macros.hpp" 51 52 // ciObjectFactory 53 // 54 // This class handles requests for the creation of new instances 55 // of ciObject and its subclasses. It contains a caching mechanism 56 // which ensures that for each oop, at most one ciObject is created. 57 // This invariant allows more efficient implementation of ciObject. 58 // 59 // Implementation note: the oop->ciObject mapping is represented as 60 // a table stored in an array. Even though objects are moved 61 // by the garbage collector, the compactor preserves their relative 62 // order; address comparison of oops (in perm space) is safe so long 63 // as we prohibit GC during our comparisons. We currently use binary 64 // search to find the oop in the table, and inserting a new oop 65 // into the table may be costly. If this cost ends up being 66 // problematic the underlying data structure can be switched to some 67 // sort of balanced binary tree. 68 69 GrowableArray<ciMetadata*>* ciObjectFactory::_shared_ci_metadata = NULL; |