223 manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL); |
223 manipulatePLL(SurrogateLockerThread::releaseAndNotifyPLL); |
224 } |
224 } |
225 |
225 |
226 void VM_CGC_Operation::doit() { |
226 void VM_CGC_Operation::doit() { |
227 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); |
227 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); |
228 GCTraceTime t(_printGCMessage, G1Log::fine(), true, G1CollectedHeap::heap()->gc_timer_cm(), G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()); |
228 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
229 SharedHeap* sh = SharedHeap::heap(); |
229 GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm(), g1h->concurrent_mark()->concurrent_gc_id()); |
230 // This could go away if CollectedHeap gave access to _gc_is_active... |
230 IsGCActiveMark x; |
231 if (sh != NULL) { |
231 _cl->do_void(); |
232 IsGCActiveMark x; |
|
233 _cl->do_void(); |
|
234 } else { |
|
235 _cl->do_void(); |
|
236 } |
|
237 } |
232 } |
238 |
233 |
239 bool VM_CGC_Operation::doit_prologue() { |
234 bool VM_CGC_Operation::doit_prologue() { |
240 // Note the relative order of the locks must match that in |
235 // Note the relative order of the locks must match that in |
241 // VM_GC_Operation::doit_prologue() or deadlocks can occur |
236 // VM_GC_Operation::doit_prologue() or deadlocks can occur |
242 if (_needs_pll) { |
237 if (_needs_pll) { |
243 acquire_pending_list_lock(); |
238 acquire_pending_list_lock(); |
244 } |
239 } |
245 |
240 |
246 Heap_lock->lock(); |
241 Heap_lock->lock(); |
247 SharedHeap::heap()->_thread_holds_heap_lock_for_gc = true; |
|
248 return true; |
242 return true; |
249 } |
243 } |
250 |
244 |
251 void VM_CGC_Operation::doit_epilogue() { |
245 void VM_CGC_Operation::doit_epilogue() { |
252 // Note the relative order of the unlocks must match that in |
246 // Note the relative order of the unlocks must match that in |
253 // VM_GC_Operation::doit_epilogue() |
247 // VM_GC_Operation::doit_epilogue() |
254 SharedHeap::heap()->_thread_holds_heap_lock_for_gc = false; |
|
255 Heap_lock->unlock(); |
248 Heap_lock->unlock(); |
256 if (_needs_pll) { |
249 if (_needs_pll) { |
257 release_and_notify_pending_list_lock(); |
250 release_and_notify_pending_list_lock(); |
258 } |
251 } |
259 } |
252 } |