22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "runtime/mutexLocker.hpp"
27 #include "runtime/os.inline.hpp"
28 #include "runtime/safepoint.hpp"
29 #include "runtime/thread.inline.hpp"
30 #include "runtime/vmThread.hpp"
31
32 // Mutexes used in the VM (see comment in mutexLocker.hpp):
33 //
34 // Note that the following pointers are effectively final -- after having been
35 // set at JVM startup-time, they should never be subsequently mutated.
36 // Instead of using pointers to malloc()ed monitors and mutexes we should consider
37 // eliminating the indirection and using instances instead.
38 // Consider using GCC's __read_mostly.
39
40 Mutex* Patching_lock = NULL;
41 Monitor* SystemDictionary_lock = NULL;
42 Mutex* Module_lock = NULL;
43 Mutex* CompiledIC_lock = NULL;
44 Mutex* InlineCacheBuffer_lock = NULL;
45 Mutex* VMStatistic_lock = NULL;
46 Mutex* JNIGlobalAlloc_lock = NULL;
47 Mutex* JNIGlobalActive_lock = NULL;
48 Mutex* JNIWeakAlloc_lock = NULL;
49 Mutex* JNIWeakActive_lock = NULL;
50 Mutex* JNIHandleBlockFreeList_lock = NULL;
51 Mutex* VMWeakAlloc_lock = NULL;
52 Mutex* VMWeakActive_lock = NULL;
53 Mutex* ResolvedMethodTable_lock = NULL;
54 Mutex* JmethodIdCreation_lock = NULL;
55 Mutex* JfieldIdCreation_lock = NULL;
56 Monitor* JNICritical_lock = NULL;
57 Mutex* JvmtiThreadState_lock = NULL;
58 Monitor* Heap_lock = NULL;
59 Mutex* ExpandHeap_lock = NULL;
60 Mutex* AdapterHandlerLibrary_lock = NULL;
61 Mutex* SignatureHandlerLibrary_lock = NULL;
204 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
205 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
206
207 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
208 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
209 }
210 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_sometimes);
211 def(DerivedPointerTableGC_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
212 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_sometimes);
213 def(CodeCache_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
214 def(RawMonitor_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
215 def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
216
217 def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never);
218
219 def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching.
220 def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations
221 def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for creating jmethodIDs.
222
223 def(SystemDictionary_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread
224 def(Module_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always);
225 def(InlineCacheBuffer_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always);
226 def(VMStatistic_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always);
227 def(ExpandHeap_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // Used during compilation by VM thread
228 def(JNIHandleBlockFreeList_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); // handles are used by VM thread
229 def(SignatureHandlerLibrary_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always);
230 def(SymbolTable_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always);
231 def(StringTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always);
232 def(ProfilePrint_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
233 def(ExceptionCache_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
234 def(OsrList_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
235 def(Debug1_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
236 #ifndef PRODUCT
237 def(FullGCALot_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // a lock to make FullGCALot MT safe
238 #endif
239 def(BeforeExit_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always);
240 def(PerfDataMemAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for allocating PerfData memory for performance data
241 def(PerfDataManager_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for synchronized access to PerfDataManager resources
242
243 // CMS_modUnionTable_lock leaf
|
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "runtime/mutexLocker.hpp"
27 #include "runtime/os.inline.hpp"
28 #include "runtime/safepoint.hpp"
29 #include "runtime/thread.inline.hpp"
30 #include "runtime/vmThread.hpp"
31
32 // Mutexes used in the VM (see comment in mutexLocker.hpp):
33 //
34 // Note that the following pointers are effectively final -- after having been
35 // set at JVM startup-time, they should never be subsequently mutated.
36 // Instead of using pointers to malloc()ed monitors and mutexes we should consider
37 // eliminating the indirection and using instances instead.
38 // Consider using GCC's __read_mostly.
39
40 Mutex* Patching_lock = NULL;
41 Monitor* SystemDictionary_lock = NULL;
42 Mutex* SharedDictionary_lock = NULL;
43 Mutex* Module_lock = NULL;
44 Mutex* CompiledIC_lock = NULL;
45 Mutex* InlineCacheBuffer_lock = NULL;
46 Mutex* VMStatistic_lock = NULL;
47 Mutex* JNIGlobalAlloc_lock = NULL;
48 Mutex* JNIGlobalActive_lock = NULL;
49 Mutex* JNIWeakAlloc_lock = NULL;
50 Mutex* JNIWeakActive_lock = NULL;
51 Mutex* JNIHandleBlockFreeList_lock = NULL;
52 Mutex* VMWeakAlloc_lock = NULL;
53 Mutex* VMWeakActive_lock = NULL;
54 Mutex* ResolvedMethodTable_lock = NULL;
55 Mutex* JmethodIdCreation_lock = NULL;
56 Mutex* JfieldIdCreation_lock = NULL;
57 Monitor* JNICritical_lock = NULL;
58 Mutex* JvmtiThreadState_lock = NULL;
59 Monitor* Heap_lock = NULL;
60 Mutex* ExpandHeap_lock = NULL;
61 Mutex* AdapterHandlerLibrary_lock = NULL;
62 Mutex* SignatureHandlerLibrary_lock = NULL;
205 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_never);
206 def(StringDedupTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
207
208 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
209 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never);
210 }
211 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_sometimes);
212 def(DerivedPointerTableGC_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
213 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_sometimes);
214 def(CodeCache_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
215 def(RawMonitor_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
216 def(OopMapCacheAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for oop_map_cache allocation.
217
218 def(MetaspaceExpand_lock , PaddedMutex , leaf-1, true, Monitor::_safepoint_check_never);
219
220 def(Patching_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); // used for safepointing and code patching.
221 def(Service_lock , PaddedMonitor, special, true, Monitor::_safepoint_check_never); // used for service thread operations
222 def(JmethodIdCreation_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for creating jmethodIDs.
223
224 def(SystemDictionary_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread
225 def(SharedDictionary_lock , PaddedMutex, leaf, true, Monitor::_safepoint_check_always); // lookups done by VM thread
226 def(Module_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always);
227 def(InlineCacheBuffer_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always);
228 def(VMStatistic_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always);
229 def(ExpandHeap_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // Used during compilation by VM thread
230 def(JNIHandleBlockFreeList_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); // handles are used by VM thread
231 def(SignatureHandlerLibrary_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always);
232 def(SymbolTable_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always);
233 def(StringTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always);
234 def(ProfilePrint_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
235 def(ExceptionCache_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
236 def(OsrList_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
237 def(Debug1_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never);
238 #ifndef PRODUCT
239 def(FullGCALot_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // a lock to make FullGCALot MT safe
240 #endif
241 def(BeforeExit_lock , PaddedMonitor, leaf, true, Monitor::_safepoint_check_always);
242 def(PerfDataMemAlloc_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for allocating PerfData memory for performance data
243 def(PerfDataManager_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // used for synchronized access to PerfDataManager resources
244
245 // CMS_modUnionTable_lock leaf
|