< prev index next >

src/hotspot/share/runtime/mutexLocker.cpp

Print this page
rev 52886 : imported patch new_rank


 182   fatal("must own lock %s", lock->name());
 183 }
 184 
 185 // a stronger assertion than the above
 186 void assert_lock_strong(const Monitor * lock) {
 187   if (IgnoreLockingAssertions) return;
 188   assert(lock != NULL, "Need non-NULL lock");
 189   if (lock->owned_by_self()) return;
 190   fatal("must own lock %s", lock->name());
 191 }
 192 #endif
 193 
 194 #define def(var, type, pri, vm_block, safepoint_check_allowed ) {      \
 195   var = new type(Mutex::pri, #var, vm_block, safepoint_check_allowed); \
 196   assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX");        \
 197   _mutex_array[_num_mutex++] = var;                                      \
 198 }
 199 
 200 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
 201 void mutex_init() {
 202   def(tty_lock                     , PaddedMutex  , event,       true,  Monitor::_safepoint_check_never);      // allow to lock in VM
 203 
 204   def(CGC_lock                     , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);      // coordinate between fore- and background GC
 205   def(STS_lock                     , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 206 
 207   def(VMWeakAlloc_lock             , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
 208   def(VMWeakActive_lock            , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
 209 
 210   def(StringTableWeakAlloc_lock    , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
 211   def(StringTableWeakActive_lock   , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
 212 
 213   if (UseConcMarkSweepGC || UseG1GC) {
 214     def(FullGCCount_lock           , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);      // in support of ExplicitGCInvokesConcurrent
 215   }
 216   if (UseG1GC) {
 217     def(SATB_Q_FL_lock             , PaddedMutex  , access,      true,  Monitor::_safepoint_check_never);
 218     def(SATB_Q_CBL_mon             , PaddedMonitor, access,      true,  Monitor::_safepoint_check_never);
 219     def(Shared_SATB_Q_lock         , PaddedMutex  , access + 1,  true,  Monitor::_safepoint_check_never);
 220 
 221     def(DirtyCardQ_FL_lock         , PaddedMutex  , access,      true,  Monitor::_safepoint_check_never);
 222     def(DirtyCardQ_CBL_mon         , PaddedMonitor, access,      true,  Monitor::_safepoint_check_never);




 182   fatal("must own lock %s", lock->name());
 183 }
 184 
 185 // a stronger assertion than the above
 186 void assert_lock_strong(const Monitor * lock) {
 187   if (IgnoreLockingAssertions) return;
 188   assert(lock != NULL, "Need non-NULL lock");
 189   if (lock->owned_by_self()) return;
 190   fatal("must own lock %s", lock->name());
 191 }
 192 #endif
 193 
 194 #define def(var, type, pri, vm_block, safepoint_check_allowed ) {      \
 195   var = new type(Mutex::pri, #var, vm_block, safepoint_check_allowed); \
 196   assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX");        \
 197   _mutex_array[_num_mutex++] = var;                                      \
 198 }
 199 
 200 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
 201 void mutex_init() {
 202   def(tty_lock                     , PaddedMutex  , tty,         true,  Monitor::_safepoint_check_never);      // allow to lock in VM
 203 
 204   def(CGC_lock                     , PaddedMonitor, special,     true,  Monitor::_safepoint_check_never);      // coordinate between fore- and background GC
 205   def(STS_lock                     , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);
 206 
 207   def(VMWeakAlloc_lock             , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
 208   def(VMWeakActive_lock            , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
 209 
 210   def(StringTableWeakAlloc_lock    , PaddedMutex  , vmweak,      true,  Monitor::_safepoint_check_never);
 211   def(StringTableWeakActive_lock   , PaddedMutex  , vmweak-1,    true,  Monitor::_safepoint_check_never);
 212 
 213   if (UseConcMarkSweepGC || UseG1GC) {
 214     def(FullGCCount_lock           , PaddedMonitor, leaf,        true,  Monitor::_safepoint_check_never);      // in support of ExplicitGCInvokesConcurrent
 215   }
 216   if (UseG1GC) {
 217     def(SATB_Q_FL_lock             , PaddedMutex  , access,      true,  Monitor::_safepoint_check_never);
 218     def(SATB_Q_CBL_mon             , PaddedMonitor, access,      true,  Monitor::_safepoint_check_never);
 219     def(Shared_SATB_Q_lock         , PaddedMutex  , access + 1,  true,  Monitor::_safepoint_check_never);
 220 
 221     def(DirtyCardQ_FL_lock         , PaddedMutex  , access,      true,  Monitor::_safepoint_check_never);
 222     def(DirtyCardQ_CBL_mon         , PaddedMonitor, access,      true,  Monitor::_safepoint_check_never);


< prev index next >