< prev index next >

src/share/vm/gc/cms/vmCMSOperations.cpp

Print this page




  41   // The caller may block while communicating
  42   // with the SLT thread in order to acquire/release the PLL.
  43   SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
  44   if (slt != NULL) {
  45     slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
  46   } else {
  47     SurrogateLockerThread::report_missing_slt();
  48   }
  49 }
  50 
  51 void VM_CMS_Operation::release_and_notify_pending_list_lock() {
  52   // The caller may block while communicating
  53   // with the SLT thread in order to acquire/release the PLL.
  54   ConcurrentMarkSweepThread::slt()->
  55     manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
  56 }
  57 
  58 void VM_CMS_Operation::verify_before_gc() {
  59   if (VerifyBeforeGC &&
  60       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  61     GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm);
  62     HandleMark hm;
  63     FreelistLocker x(_collector);
  64     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  65     GenCollectedHeap::heap()->prepare_for_verify();
  66     Universe::verify();
  67   }
  68 }
  69 
  70 void VM_CMS_Operation::verify_after_gc() {
  71   if (VerifyAfterGC &&
  72       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  73     GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm);
  74     HandleMark hm;
  75     FreelistLocker x(_collector);
  76     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  77     Universe::verify();
  78   }
  79 }
  80 
  81 bool VM_CMS_Operation::lost_race() const {
  82   if (CMSCollector::abstract_state() == CMSCollector::Idling) {
  83     // We lost a race to a foreground collection
  84     // -- there's nothing to do
  85     return true;
  86   }
  87   assert(CMSCollector::abstract_state() == legal_state(),
  88          "Inconsistent collector state?");
  89   return false;
  90 }
  91 
  92 bool VM_CMS_Operation::doit_prologue() {
  93   assert(Thread::current()->is_ConcurrentGC_thread(), "just checking");




  41   // The caller may block while communicating
  42   // with the SLT thread in order to acquire/release the PLL.
  43   SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
  44   if (slt != NULL) {
  45     slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
  46   } else {
  47     SurrogateLockerThread::report_missing_slt();
  48   }
  49 }
  50 
  51 void VM_CMS_Operation::release_and_notify_pending_list_lock() {
  52   // The caller may block while communicating
  53   // with the SLT thread in order to acquire/release the PLL.
  54   ConcurrentMarkSweepThread::slt()->
  55     manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL);
  56 }
  57 
  58 void VM_CMS_Operation::verify_before_gc() {
  59   if (VerifyBeforeGC &&
  60       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  61     GCTraceTime(Info, gc, verify) tm("Verify Before", _collector->_gc_timer_cm);
  62     HandleMark hm;
  63     FreelistLocker x(_collector);
  64     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  65     GenCollectedHeap::heap()->prepare_for_verify();
  66     Universe::verify();
  67   }
  68 }
  69 
  70 void VM_CMS_Operation::verify_after_gc() {
  71   if (VerifyAfterGC &&
  72       GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
  73     GCTraceTime(Info, gc, verify) tm("Verify After", _collector->_gc_timer_cm);
  74     HandleMark hm;
  75     FreelistLocker x(_collector);
  76     MutexLockerEx  y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
  77     Universe::verify();
  78   }
  79 }
  80 
  81 bool VM_CMS_Operation::lost_race() const {
  82   if (CMSCollector::abstract_state() == CMSCollector::Idling) {
  83     // We lost a race to a foreground collection
  84     // -- there's nothing to do
  85     return true;
  86   }
  87   assert(CMSCollector::abstract_state() == legal_state(),
  88          "Inconsistent collector state?");
  89   return false;
  90 }
  91 
  92 bool VM_CMS_Operation::doit_prologue() {
  93   assert(Thread::current()->is_ConcurrentGC_thread(), "just checking");


< prev index next >