29 #include "runtime/thread.inline.hpp"
30 #include "runtime/threadLocalStorage.hpp"
31 #include "runtime/vmThread.hpp"
32
33 // Mutexes used in the VM (see comment in mutexLocker.hpp):
34 //
35 // Note that the following pointers are effectively final -- after having been
36 // set at JVM startup-time, they should never be subsequently mutated.
37 // Instead of using pointers to malloc()ed monitors and mutexes we should consider
38 // eliminating the indirection and using instances instead.
39 // Consider using GCC's __read_mostly.
40
41 Mutex* Patching_lock = NULL;
42 Monitor* SystemDictionary_lock = NULL;
43 Mutex* PackageTable_lock = NULL;
44 Mutex* CompiledIC_lock = NULL;
45 Mutex* InlineCacheBuffer_lock = NULL;
46 Mutex* VMStatistic_lock = NULL;
47 Mutex* JNIGlobalHandle_lock = NULL;
48 Mutex* JNIHandleBlockFreeList_lock = NULL;
49 Mutex* MemberNameTable_lock = NULL;
50 Mutex* JmethodIdCreation_lock = NULL;
51 Mutex* JfieldIdCreation_lock = NULL;
52 Monitor* JNICritical_lock = NULL;
53 Mutex* JvmtiThreadState_lock = NULL;
54 Monitor* JvmtiPendingEvent_lock = NULL;
55 Monitor* Heap_lock = NULL;
56 Mutex* ExpandHeap_lock = NULL;
57 Mutex* AdapterHandlerLibrary_lock = NULL;
58 Mutex* SignatureHandlerLibrary_lock = NULL;
59 Mutex* VtableStubs_lock = NULL;
60 Mutex* SymbolTable_lock = NULL;
61 Mutex* StringTable_lock = NULL;
62 Monitor* StringDedupQueue_lock = NULL;
63 Mutex* StringDedupTable_lock = NULL;
64 Mutex* CodeCache_lock = NULL;
65 Mutex* MethodData_lock = NULL;
66 Mutex* RetData_lock = NULL;
67 Monitor* VMOperationQueue_lock = NULL;
68 Monitor* VMOperationRequest_lock = NULL;
69 Monitor* Safepoint_lock = NULL;
241
242 def(Safepoint_lock , Monitor, safepoint, true ); // locks SnippetCache_lock/Threads_lock
243
244 def(Threads_lock , Monitor, barrier, true );
245
246 def(VMOperationQueue_lock , Monitor, nonleaf, true ); // VM_thread allowed to block on these
247 def(VMOperationRequest_lock , Monitor, nonleaf, true );
248 def(RetData_lock , Mutex , nonleaf, false);
249 def(Terminator_lock , Monitor, nonleaf, true );
250 def(VtableStubs_lock , Mutex , nonleaf, true );
251 def(Notify_lock , Monitor, nonleaf, true );
252 def(JNIGlobalHandle_lock , Mutex , nonleaf, true ); // locks JNIHandleBlockFreeList_lock
253 def(JNICritical_lock , Monitor, nonleaf, true ); // used for JNI critical regions
254 def(AdapterHandlerLibrary_lock , Mutex , nonleaf, true);
255 if (UseConcMarkSweepGC) {
256 def(SLT_lock , Monitor, nonleaf, false );
257 // used in CMS GC for locking PLL lock
258 }
259 def(Heap_lock , Monitor, nonleaf+1, false);
260 def(JfieldIdCreation_lock , Mutex , nonleaf+1, true ); // jfieldID, Used in VM_Operation
261 def(MemberNameTable_lock , Mutex , nonleaf+1, false); // Used to protect MemberNameTable
262
263 def(CompiledIC_lock , Mutex , nonleaf+2, false); // locks VtableStubs_lock, InlineCacheBuffer_lock
264 def(CompileTaskAlloc_lock , Mutex , nonleaf+2, true );
265 def(CompileStatistics_lock , Mutex , nonleaf+2, false);
266 def(MultiArray_lock , Mutex , nonleaf+2, false); // locks SymbolTable_lock
267
268 def(JvmtiThreadState_lock , Mutex , nonleaf+2, false); // Used by JvmtiThreadState/JvmtiEventController
269 def(JvmtiPendingEvent_lock , Monitor, nonleaf, false); // Used by JvmtiCodeBlobEvents
270 def(Management_lock , Mutex , nonleaf+2, false); // used for JVM management
271
272 def(Compile_lock , Mutex , nonleaf+3, true );
273 def(MethodData_lock , Mutex , nonleaf+3, false);
274
275 def(MethodCompileQueue_lock , Monitor, nonleaf+4, true );
276 def(Debug2_lock , Mutex , nonleaf+4, true );
277 def(Debug3_lock , Mutex , nonleaf+4, true );
278 def(ProfileVM_lock , Monitor, special, false); // used for profiling of the VMThread
279 def(CompileThread_lock , Monitor, nonleaf+5, false );
280 def(PeriodicTask_lock , Monitor, nonleaf+5, true);
281
|
29 #include "runtime/thread.inline.hpp"
30 #include "runtime/threadLocalStorage.hpp"
31 #include "runtime/vmThread.hpp"
32
33 // Mutexes used in the VM (see comment in mutexLocker.hpp):
34 //
35 // Note that the following pointers are effectively final -- after having been
36 // set at JVM startup-time, they should never be subsequently mutated.
37 // Instead of using pointers to malloc()ed monitors and mutexes we should consider
38 // eliminating the indirection and using instances instead.
39 // Consider using GCC's __read_mostly.
40
41 Mutex* Patching_lock = NULL;
42 Monitor* SystemDictionary_lock = NULL;
43 Mutex* PackageTable_lock = NULL;
44 Mutex* CompiledIC_lock = NULL;
45 Mutex* InlineCacheBuffer_lock = NULL;
46 Mutex* VMStatistic_lock = NULL;
47 Mutex* JNIGlobalHandle_lock = NULL;
48 Mutex* JNIHandleBlockFreeList_lock = NULL;
49 Mutex* JmethodIdCreation_lock = NULL;
50 Mutex* JfieldIdCreation_lock = NULL;
51 Monitor* JNICritical_lock = NULL;
52 Mutex* JvmtiThreadState_lock = NULL;
53 Monitor* JvmtiPendingEvent_lock = NULL;
54 Monitor* Heap_lock = NULL;
55 Mutex* ExpandHeap_lock = NULL;
56 Mutex* AdapterHandlerLibrary_lock = NULL;
57 Mutex* SignatureHandlerLibrary_lock = NULL;
58 Mutex* VtableStubs_lock = NULL;
59 Mutex* SymbolTable_lock = NULL;
60 Mutex* StringTable_lock = NULL;
61 Monitor* StringDedupQueue_lock = NULL;
62 Mutex* StringDedupTable_lock = NULL;
63 Mutex* CodeCache_lock = NULL;
64 Mutex* MethodData_lock = NULL;
65 Mutex* RetData_lock = NULL;
66 Monitor* VMOperationQueue_lock = NULL;
67 Monitor* VMOperationRequest_lock = NULL;
68 Monitor* Safepoint_lock = NULL;
240
241 def(Safepoint_lock , Monitor, safepoint, true ); // locks SnippetCache_lock/Threads_lock
242
243 def(Threads_lock , Monitor, barrier, true );
244
245 def(VMOperationQueue_lock , Monitor, nonleaf, true ); // VM_thread allowed to block on these
246 def(VMOperationRequest_lock , Monitor, nonleaf, true );
247 def(RetData_lock , Mutex , nonleaf, false);
248 def(Terminator_lock , Monitor, nonleaf, true );
249 def(VtableStubs_lock , Mutex , nonleaf, true );
250 def(Notify_lock , Monitor, nonleaf, true );
251 def(JNIGlobalHandle_lock , Mutex , nonleaf, true ); // locks JNIHandleBlockFreeList_lock
252 def(JNICritical_lock , Monitor, nonleaf, true ); // used for JNI critical regions
253 def(AdapterHandlerLibrary_lock , Mutex , nonleaf, true);
254 if (UseConcMarkSweepGC) {
255 def(SLT_lock , Monitor, nonleaf, false );
256 // used in CMS GC for locking PLL lock
257 }
258 def(Heap_lock , Monitor, nonleaf+1, false);
259 def(JfieldIdCreation_lock , Mutex , nonleaf+1, true ); // jfieldID, Used in VM_Operation
260
261 def(CompiledIC_lock , Mutex , nonleaf+2, false); // locks VtableStubs_lock, InlineCacheBuffer_lock
262 def(CompileTaskAlloc_lock , Mutex , nonleaf+2, true );
263 def(CompileStatistics_lock , Mutex , nonleaf+2, false);
264 def(MultiArray_lock , Mutex , nonleaf+2, false); // locks SymbolTable_lock
265
266 def(JvmtiThreadState_lock , Mutex , nonleaf+2, false); // Used by JvmtiThreadState/JvmtiEventController
267 def(JvmtiPendingEvent_lock , Monitor, nonleaf, false); // Used by JvmtiCodeBlobEvents
268 def(Management_lock , Mutex , nonleaf+2, false); // used for JVM management
269
270 def(Compile_lock , Mutex , nonleaf+3, true );
271 def(MethodData_lock , Mutex , nonleaf+3, false);
272
273 def(MethodCompileQueue_lock , Monitor, nonleaf+4, true );
274 def(Debug2_lock , Mutex , nonleaf+4, true );
275 def(Debug3_lock , Mutex , nonleaf+4, true );
276 def(ProfileVM_lock , Monitor, special, false); // used for profiling of the VMThread
277 def(CompileThread_lock , Monitor, nonleaf+5, false );
278 def(PeriodicTask_lock , Monitor, nonleaf+5, true);
279
|