equal
deleted
inserted
replaced
22 */ |
22 */ |
23 |
23 |
24 #include "precompiled.hpp" |
24 #include "precompiled.hpp" |
25 #include "classfile/systemDictionary.hpp" |
25 #include "classfile/systemDictionary.hpp" |
26 #include "gc/shared/collectedHeap.hpp" |
26 #include "gc/shared/collectedHeap.hpp" |
27 #include "gc/shared/oopStorage.inline.hpp" |
27 #include "gc/shared/oopStorage.hpp" |
28 #include "jvmci/jvmci.hpp" |
28 #include "jvmci/jvmci.hpp" |
29 #include "jvmci/jvmciJavaClasses.hpp" |
29 #include "jvmci/jvmciJavaClasses.hpp" |
30 #include "jvmci/jvmciRuntime.hpp" |
30 #include "jvmci/jvmciRuntime.hpp" |
31 #include "jvmci/metadataHandleBlock.hpp" |
31 #include "jvmci/metadataHandleBlock.hpp" |
32 #include "memory/universe.hpp" |
32 #include "memory/universe.hpp" |
56 |
56 |
57 JVMCI::compiler_runtime()->call_getCompiler(CHECK); |
57 JVMCI::compiler_runtime()->call_getCompiler(CHECK); |
58 } |
58 } |
59 |
59 |
60 void JVMCI::initialize_globals() { |
60 void JVMCI::initialize_globals() { |
61 _object_handles = new OopStorage("JVMCI Global Oop Handles", |
61 _object_handles = SystemDictionary::vm_global_oop_storage(); |
62 JVMCIGlobalAlloc_lock, |
|
63 JVMCIGlobalActive_lock); |
|
64 _metadata_handles = MetadataHandleBlock::allocate_block(); |
62 _metadata_handles = MetadataHandleBlock::allocate_block(); |
65 if (UseJVMCINativeLibrary) { |
63 if (UseJVMCINativeLibrary) { |
66 // There are two runtimes. |
64 // There are two runtimes. |
67 _compiler_runtime = new JVMCIRuntime(); |
65 _compiler_runtime = new JVMCIRuntime(); |
68 _java_runtime = new JVMCIRuntime(); |
66 _java_runtime = new JVMCIRuntime(); |
113 void JVMCI::release_handle(jmetadata handle) { |
111 void JVMCI::release_handle(jmetadata handle) { |
114 MutexLocker ml(JVMCI_lock); |
112 MutexLocker ml(JVMCI_lock); |
115 _metadata_handles->chain_free_list(handle); |
113 _metadata_handles->chain_free_list(handle); |
116 } |
114 } |
117 |
115 |
118 void JVMCI::oops_do(OopClosure* f) { |
|
119 if (_object_handles != NULL) { |
|
120 _object_handles->oops_do(f); |
|
121 } |
|
122 } |
|
123 |
|
124 void JVMCI::metadata_do(void f(Metadata*)) { |
116 void JVMCI::metadata_do(void f(Metadata*)) { |
125 if (_metadata_handles != NULL) { |
117 if (_metadata_handles != NULL) { |
126 _metadata_handles->metadata_do(f); |
118 _metadata_handles->metadata_do(f); |
127 } |
119 } |
128 } |
120 } |