< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp

Print this page
rev 59498 : 8245880: Shenandoah: check class unloading flag early in concurrent code root scan
rev 59499 : 8246162: Shenandoah: full GC does not mark code roots when class unloading is off


 250       SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set();
 251       while (satb_mq_set.apply_closure_to_completed_buffer(&cl));
 252       bool do_nmethods = heap->unload_classes() && !ShenandoahConcurrentRoots::can_do_concurrent_class_unloading();
 253       if (heap->has_forwarded_objects()) {
 254         ShenandoahMarkResolveRefsClosure resolve_mark_cl(q, rp);
 255         MarkingCodeBlobClosure blobsCl(&resolve_mark_cl, !CodeBlobToOopClosure::FixRelocations);
 256         ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
 257                                                           ShenandoahStoreValEnqueueBarrier ? &resolve_mark_cl : NULL,
 258                                                           do_nmethods ? &blobsCl : NULL);
 259         Threads::threads_do(&tc);
 260       } else {
 261         ShenandoahMarkRefsClosure mark_cl(q, rp);
 262         MarkingCodeBlobClosure blobsCl(&mark_cl, !CodeBlobToOopClosure::FixRelocations);
 263         ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
 264                                                           ShenandoahStoreValEnqueueBarrier ? &mark_cl : NULL,
 265                                                           do_nmethods ? &blobsCl : NULL);
 266         Threads::threads_do(&tc);
 267       }
 268     }
 269 
 270     if (heap->is_degenerated_gc_in_progress()) {
 271       // Degenerated cycle may bypass concurrent cycle, so code roots might not be scanned,
 272       // let's check here.

 273       _cm->concurrent_scan_code_roots(worker_id, rp);
 274     }
 275 
 276     _cm->mark_loop(worker_id, _terminator, rp,
 277                    false, // not cancellable
 278                    _dedup_string);
 279 
 280     assert(_cm->task_queues()->is_empty(), "Should be empty");
 281   }
 282 };
 283 
 284 void ShenandoahConcurrentMark::mark_roots(ShenandoahPhaseTimings::Phase root_phase) {
 285   assert(Thread::current()->is_VM_thread(), "can only do this in VMThread");
 286   assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
 287 
 288   ShenandoahHeap* heap = ShenandoahHeap::heap();
 289 
 290   ShenandoahGCPhase phase(root_phase);
 291 
 292   WorkGang* workers = heap->workers();




 250       SATBMarkQueueSet& satb_mq_set = ShenandoahBarrierSet::satb_mark_queue_set();
 251       while (satb_mq_set.apply_closure_to_completed_buffer(&cl));
 252       bool do_nmethods = heap->unload_classes() && !ShenandoahConcurrentRoots::can_do_concurrent_class_unloading();
 253       if (heap->has_forwarded_objects()) {
 254         ShenandoahMarkResolveRefsClosure resolve_mark_cl(q, rp);
 255         MarkingCodeBlobClosure blobsCl(&resolve_mark_cl, !CodeBlobToOopClosure::FixRelocations);
 256         ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
 257                                                           ShenandoahStoreValEnqueueBarrier ? &resolve_mark_cl : NULL,
 258                                                           do_nmethods ? &blobsCl : NULL);
 259         Threads::threads_do(&tc);
 260       } else {
 261         ShenandoahMarkRefsClosure mark_cl(q, rp);
 262         MarkingCodeBlobClosure blobsCl(&mark_cl, !CodeBlobToOopClosure::FixRelocations);
 263         ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
 264                                                           ShenandoahStoreValEnqueueBarrier ? &mark_cl : NULL,
 265                                                           do_nmethods ? &blobsCl : NULL);
 266         Threads::threads_do(&tc);
 267       }
 268     }
 269 
 270     if (heap->is_degenerated_gc_in_progress() || heap->is_full_gc_in_progress()) {
 271       // Full GC does not execute concurrent cycle.
 272       // Degenerated cycle may bypass concurrent cycle.
 273       // So code roots might not be scanned, let's scan here.
 274       _cm->concurrent_scan_code_roots(worker_id, rp);
 275     }
 276 
 277     _cm->mark_loop(worker_id, _terminator, rp,
 278                    false, // not cancellable
 279                    _dedup_string);
 280 
 281     assert(_cm->task_queues()->is_empty(), "Should be empty");
 282   }
 283 };
 284 
 285 void ShenandoahConcurrentMark::mark_roots(ShenandoahPhaseTimings::Phase root_phase) {
 286   assert(Thread::current()->is_VM_thread(), "can only do this in VMThread");
 287   assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint");
 288 
 289   ShenandoahHeap* heap = ShenandoahHeap::heap();
 290 
 291   ShenandoahGCPhase phase(root_phase);
 292 
 293   WorkGang* workers = heap->workers();


< prev index next >