117 assert(!CMSCollector::foregroundGCShouldWait(), "Possible deadlock"); 118 assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(), 119 "Possible deadlock"); 120 121 // Release the Heap_lock first. 122 Heap_lock->unlock(); 123 if (needs_pll()) { 124 release_and_notify_pending_list_lock(); 125 } 126 } 127 128 ////////////////////////////////////////////////////////// 129 // Methods in class VM_CMS_Initial_Mark 130 ////////////////////////////////////////////////////////// 131 void VM_CMS_Initial_Mark::doit() { 132 if (lost_race()) { 133 // Nothing to do. 134 return; 135 } 136 HS_PRIVATE_CMS_INITMARK_BEGIN(); 137 GCIdMark gc_id_mark(_gc_id); 138 139 _collector->_gc_timer_cm->register_gc_pause_start("Initial Mark"); 140 141 GenCollectedHeap* gch = GenCollectedHeap::heap(); 142 GCCauseSetter gccs(gch, GCCause::_cms_initial_mark); 143 144 VM_CMS_Operation::verify_before_gc(); 145 146 IsGCActiveMark x; // stop-world GC active 147 _collector->do_CMS_operation(CMSCollector::CMS_op_checkpointRootsInitial, gch->gc_cause()); 148 149 VM_CMS_Operation::verify_after_gc(); 150 151 _collector->_gc_timer_cm->register_gc_pause_end(); 152 153 HS_PRIVATE_CMS_INITMARK_END(); 154 } 155 156 ////////////////////////////////////////////////////////// 157 // Methods in class VM_CMS_Final_Remark_Operation 158 ////////////////////////////////////////////////////////// 159 void VM_CMS_Final_Remark::doit() { 160 if (lost_race()) { 161 // Nothing to do. 162 return; 163 } 164 HS_PRIVATE_CMS_REMARK_BEGIN(); 165 GCIdMark gc_id_mark(_gc_id); 166 167 _collector->_gc_timer_cm->register_gc_pause_start("Final Mark"); 168 169 GenCollectedHeap* gch = GenCollectedHeap::heap(); 170 GCCauseSetter gccs(gch, GCCause::_cms_final_remark); 171 172 VM_CMS_Operation::verify_before_gc(); 173 174 IsGCActiveMark x; // stop-world GC active 175 _collector->do_CMS_operation(CMSCollector::CMS_op_checkpointRootsFinal, gch->gc_cause()); 176 177 VM_CMS_Operation::verify_after_gc(); 178 179 _collector->save_heap_summary(); 180 _collector->_gc_timer_cm->register_gc_pause_end(); 181 182 HS_PRIVATE_CMS_REMARK_END(); 183 } 184 185 // VM operation to invoke a concurrent collection of a | 117 assert(!CMSCollector::foregroundGCShouldWait(), "Possible deadlock"); 118 assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(), 119 "Possible deadlock"); 120 121 // Release the Heap_lock first. 122 Heap_lock->unlock(); 123 if (needs_pll()) { 124 release_and_notify_pending_list_lock(); 125 } 126 } 127 128 ////////////////////////////////////////////////////////// 129 // Methods in class VM_CMS_Initial_Mark 130 ////////////////////////////////////////////////////////// 131 void VM_CMS_Initial_Mark::doit() { 132 if (lost_race()) { 133 // Nothing to do. 134 return; 135 } 136 HS_PRIVATE_CMS_INITMARK_BEGIN(); 137 138 _collector->_gc_timer_cm->register_gc_pause_start("Initial Mark"); 139 140 GenCollectedHeap* gch = GenCollectedHeap::heap(); 141 GCCauseSetter gccs(gch, GCCause::_cms_initial_mark); 142 143 VM_CMS_Operation::verify_before_gc(); 144 145 IsGCActiveMark x; // stop-world GC active 146 _collector->do_CMS_operation(CMSCollector::CMS_op_checkpointRootsInitial, gch->gc_cause()); 147 148 VM_CMS_Operation::verify_after_gc(); 149 150 _collector->_gc_timer_cm->register_gc_pause_end(); 151 152 HS_PRIVATE_CMS_INITMARK_END(); 153 } 154 155 ////////////////////////////////////////////////////////// 156 // Methods in class VM_CMS_Final_Remark_Operation 157 ////////////////////////////////////////////////////////// 158 void VM_CMS_Final_Remark::doit() { 159 if (lost_race()) { 160 // Nothing to do. 161 return; 162 } 163 HS_PRIVATE_CMS_REMARK_BEGIN(); 164 165 _collector->_gc_timer_cm->register_gc_pause_start("Final Mark"); 166 167 GenCollectedHeap* gch = GenCollectedHeap::heap(); 168 GCCauseSetter gccs(gch, GCCause::_cms_final_remark); 169 170 VM_CMS_Operation::verify_before_gc(); 171 172 IsGCActiveMark x; // stop-world GC active 173 _collector->do_CMS_operation(CMSCollector::CMS_op_checkpointRootsFinal, gch->gc_cause()); 174 175 VM_CMS_Operation::verify_after_gc(); 176 177 _collector->save_heap_summary(); 178 _collector->_gc_timer_cm->register_gc_pause_end(); 179 180 HS_PRIVATE_CMS_REMARK_END(); 181 } 182 183 // VM operation to invoke a concurrent collection of a |