< prev index next >

src/hotspot/share/runtime/mutexLocker.cpp

Print this page
rev 47591 : [mq]: heap10a
rev 47592 : [mq]: heap14_rebased


 107 
 108 Mutex*   tty_lock                     = NULL;
 109 
 110 Mutex*   RawMonitor_lock              = NULL;
 111 Mutex*   PerfDataMemAlloc_lock        = NULL;
 112 Mutex*   PerfDataManager_lock         = NULL;
 113 Mutex*   OopMapCacheAlloc_lock        = NULL;
 114 
 115 Mutex*   FreeList_lock                = NULL;
 116 Monitor* SecondaryFreeList_lock       = NULL;
 117 Mutex*   OldSets_lock                 = NULL;
 118 Monitor* RootRegionScan_lock          = NULL;
 119 
 120 Monitor* GCTaskManager_lock           = NULL;
 121 
 122 Mutex*   Management_lock              = NULL;
 123 Monitor* Service_lock                 = NULL;
 124 Monitor* PeriodicTask_lock            = NULL;
 125 Monitor* RedefineClasses_lock         = NULL;
 126 



 127 #if INCLUDE_TRACE
 128 Mutex*   JfrStacktrace_lock           = NULL;
 129 Monitor* JfrMsg_lock                  = NULL;
 130 Mutex*   JfrBuffer_lock               = NULL;
 131 Mutex*   JfrStream_lock               = NULL;
 132 Mutex*   JfrThreadGroups_lock         = NULL;
 133 #endif
 134 
 135 #ifndef SUPPORTS_NATIVE_CX8
 136 Mutex*   UnsafeJlong_lock             = NULL;
 137 #endif
 138 
 139 #define MAX_NUM_MUTEX 128
 140 static Monitor * _mutex_array[MAX_NUM_MUTEX];
 141 static int _num_mutex;
 142 
 143 #ifdef ASSERT
 144 void assert_locked_or_safepoint(const Monitor * lock) {
 145   // check if this thread owns the lock (common case)
 146   if (IgnoreLockingAssertions) return;


 256 
 257   def(CompiledIC_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // locks VtableStubs_lock, InlineCacheBuffer_lock
 258   def(CompileTaskAlloc_lock        , PaddedMutex  , nonleaf+2,   true,  Monitor::_safepoint_check_always);
 259   def(CompileStatistics_lock       , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);
 260   def(DirectivesStack_lock         , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 261   def(MultiArray_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // locks SymbolTable_lock
 262 
 263   def(JvmtiThreadState_lock        , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // Used by JvmtiThreadState/JvmtiEventController
 264   def(Management_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // used for JVM management
 265 
 266   def(Compile_lock                 , PaddedMutex  , nonleaf+3,   true,  Monitor::_safepoint_check_sometimes);
 267   def(MethodData_lock              , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
 268   def(TouchedMethodLog_lock        , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
 269 
 270   def(MethodCompileQueue_lock      , PaddedMonitor, nonleaf+4,   true,  Monitor::_safepoint_check_always);
 271   def(Debug2_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
 272   def(Debug3_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
 273   def(CompileThread_lock           , PaddedMonitor, nonleaf+5,   false, Monitor::_safepoint_check_always);
 274   def(PeriodicTask_lock            , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_sometimes);
 275   def(RedefineClasses_lock         , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_always);




 276   if (WhiteBoxAPI) {
 277     def(Compilation_lock           , PaddedMonitor, leaf,        false, Monitor::_safepoint_check_never);
 278   }
 279 
 280 #if INCLUDE_TRACE
 281   def(JfrMsg_lock                  , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);
 282   def(JfrBuffer_lock               , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 283   def(JfrThreadGroups_lock         , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 284   def(JfrStream_lock               , PaddedMutex  , leaf+1,      true,  Monitor::_safepoint_check_never);      // ensure to rank lower than 'safepoint'
 285   def(JfrStacktrace_lock           , PaddedMutex  , special,     true,  Monitor::_safepoint_check_sometimes);
 286 #endif
 287 
 288 #ifndef SUPPORTS_NATIVE_CX8
 289   def(UnsafeJlong_lock             , PaddedMutex  , special,     false, Monitor::_safepoint_check_never);
 290 #endif
 291 }
 292 
 293 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
 294   if (SafepointSynchronize::is_at_safepoint()) {
 295     _locked = false;




 107 
 108 Mutex*   tty_lock                     = NULL;
 109 
 110 Mutex*   RawMonitor_lock              = NULL;
 111 Mutex*   PerfDataMemAlloc_lock        = NULL;
 112 Mutex*   PerfDataManager_lock         = NULL;
 113 Mutex*   OopMapCacheAlloc_lock        = NULL;
 114 
 115 Mutex*   FreeList_lock                = NULL;
 116 Monitor* SecondaryFreeList_lock       = NULL;
 117 Mutex*   OldSets_lock                 = NULL;
 118 Monitor* RootRegionScan_lock          = NULL;
 119 
 120 Monitor* GCTaskManager_lock           = NULL;
 121 
 122 Mutex*   Management_lock              = NULL;
 123 Monitor* Service_lock                 = NULL;
 124 Monitor* PeriodicTask_lock            = NULL;
 125 Monitor* RedefineClasses_lock         = NULL;
 126 
 127 Monitor* HeapMonitor_lock             = NULL;
 128 Monitor* HeapMonitorStorage_lock      = NULL;
 129 
 130 #if INCLUDE_TRACE
 131 Mutex*   JfrStacktrace_lock           = NULL;
 132 Monitor* JfrMsg_lock                  = NULL;
 133 Mutex*   JfrBuffer_lock               = NULL;
 134 Mutex*   JfrStream_lock               = NULL;
 135 Mutex*   JfrThreadGroups_lock         = NULL;
 136 #endif
 137 
 138 #ifndef SUPPORTS_NATIVE_CX8
 139 Mutex*   UnsafeJlong_lock             = NULL;
 140 #endif
 141 
 142 #define MAX_NUM_MUTEX 128
 143 static Monitor * _mutex_array[MAX_NUM_MUTEX];
 144 static int _num_mutex;
 145 
 146 #ifdef ASSERT
 147 void assert_locked_or_safepoint(const Monitor * lock) {
 148   // check if this thread owns the lock (common case)
 149   if (IgnoreLockingAssertions) return;


 259 
 260   def(CompiledIC_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // locks VtableStubs_lock, InlineCacheBuffer_lock
 261   def(CompileTaskAlloc_lock        , PaddedMutex  , nonleaf+2,   true,  Monitor::_safepoint_check_always);
 262   def(CompileStatistics_lock       , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);
 263   def(DirectivesStack_lock         , PaddedMutex  , special,     true,  Monitor::_safepoint_check_never);
 264   def(MultiArray_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // locks SymbolTable_lock
 265 
 266   def(JvmtiThreadState_lock        , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // Used by JvmtiThreadState/JvmtiEventController
 267   def(Management_lock              , PaddedMutex  , nonleaf+2,   false, Monitor::_safepoint_check_always);     // used for JVM management
 268 
 269   def(Compile_lock                 , PaddedMutex  , nonleaf+3,   true,  Monitor::_safepoint_check_sometimes);
 270   def(MethodData_lock              , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
 271   def(TouchedMethodLog_lock        , PaddedMutex  , nonleaf+3,   false, Monitor::_safepoint_check_always);
 272 
 273   def(MethodCompileQueue_lock      , PaddedMonitor, nonleaf+4,   true,  Monitor::_safepoint_check_always);
 274   def(Debug2_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
 275   def(Debug3_lock                  , PaddedMutex  , nonleaf+4,   true,  Monitor::_safepoint_check_never);
 276   def(CompileThread_lock           , PaddedMonitor, nonleaf+5,   false, Monitor::_safepoint_check_always);
 277   def(PeriodicTask_lock            , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_sometimes);
 278   def(RedefineClasses_lock         , PaddedMonitor, nonleaf+5,   true,  Monitor::_safepoint_check_always);
 279 
 280   def(HeapMonitorStorage_lock      , PaddedMonitor, nonleaf,     true,  Monitor::_safepoint_check_always);
 281   def(HeapMonitor_lock             , PaddedMonitor, nonleaf+1,   true,  Monitor::_safepoint_check_always);
 282 
 283   if (WhiteBoxAPI) {
 284     def(Compilation_lock           , PaddedMonitor, leaf,        false, Monitor::_safepoint_check_never);
 285   }
 286 
 287 #if INCLUDE_TRACE
 288   def(JfrMsg_lock                  , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_always);
 289   def(JfrBuffer_lock               , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_never);
 290   def(JfrThreadGroups_lock         , PaddedMutex  , leaf,        true,  Monitor::_safepoint_check_always);
 291   def(JfrStream_lock               , PaddedMutex  , leaf+1,      true,  Monitor::_safepoint_check_never);      // ensure to rank lower than 'safepoint'
 292   def(JfrStacktrace_lock           , PaddedMutex  , special,     true,  Monitor::_safepoint_check_sometimes);
 293 #endif
 294 
 295 #ifndef SUPPORTS_NATIVE_CX8
 296   def(UnsafeJlong_lock             , PaddedMutex  , special,     false, Monitor::_safepoint_check_never);
 297 #endif
 298 }
 299 
 300 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
 301   if (SafepointSynchronize::is_at_safepoint()) {
 302     _locked = false;


< prev index next >