< prev index next >

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

Print this page
rev 57866 : 8246100: Shenandoah: walk roots in more efficient order
Reviewed-by: zgu

*** 177,203 **** CodeBlobToOopClosure* codes_cl = ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() ? static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) : static_cast<CodeBlobToOopClosure*>(&blobsCl); AlwaysTrueClosure always_true; _serial_roots.oops_do(oops, worker_id); _serial_weak_roots.weak_oops_do(oops, worker_id); if (_stw_roots_processing) { _vm_roots.oops_do<OopClosure>(oops, worker_id); _weak_roots.oops_do<OopClosure>(oops, worker_id); } if (_stw_class_unloading) { CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong); _cld_roots.cld_do(&clds, worker_id); _code_roots.code_blobs_do(codes_cl, worker_id); _thread_roots.oops_do(oops, NULL, worker_id); } else { _thread_roots.oops_do(oops, codes_cl, worker_id); } - - _dedup_roots.oops_do(&always_true, oops, worker_id); } ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase), --- 177,206 ---- CodeBlobToOopClosure* codes_cl = ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() ? static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) : static_cast<CodeBlobToOopClosure*>(&blobsCl); AlwaysTrueClosure always_true; + // Process serial-claiming roots first _serial_roots.oops_do(oops, worker_id); _serial_weak_roots.weak_oops_do(oops, worker_id); + + // Process light-weight/limited parallel roots then if (_stw_roots_processing) { _vm_roots.oops_do<OopClosure>(oops, worker_id); _weak_roots.oops_do<OopClosure>(oops, worker_id); } + _dedup_roots.oops_do(&always_true, oops, worker_id); + // Process heavy-weight/fully parallel roots the last if (_stw_class_unloading) { CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong); _cld_roots.cld_do(&clds, worker_id); _code_roots.code_blobs_do(codes_cl, worker_id); _thread_roots.oops_do(oops, NULL, worker_id); } else { _thread_roots.oops_do(oops, codes_cl, worker_id); } } ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase),
*** 230,249 **** static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) : static_cast<CodeBlobToOopClosure*>(&code_blob_cl); CLDToOopClosure adjust_cld_closure(oops, ClassLoaderData::_claim_strong); AlwaysTrueClosure always_true; _serial_roots.oops_do(oops, worker_id); _vm_roots.oops_do(oops, worker_id); ! _thread_roots.oops_do(oops, NULL, worker_id); _cld_roots.cld_do(&adjust_cld_closure, worker_id); _code_roots.code_blobs_do(adjust_code_closure, worker_id); ! ! _serial_weak_roots.weak_oops_do(oops, worker_id); ! _weak_roots.oops_do<OopClosure>(oops, worker_id); ! _dedup_roots.oops_do(&always_true, oops, worker_id); } ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() : ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots), _serial_roots(ShenandoahPhaseTimings::heap_iteration_roots), --- 233,255 ---- static_cast<CodeBlobToOopClosure*>(&blobs_and_disarm_Cl) : static_cast<CodeBlobToOopClosure*>(&code_blob_cl); CLDToOopClosure adjust_cld_closure(oops, ClassLoaderData::_claim_strong); AlwaysTrueClosure always_true; + // Process serial-claiming roots first _serial_roots.oops_do(oops, worker_id); + _serial_weak_roots.weak_oops_do(oops, worker_id); + + // Process light-weight/limited parallel roots then _vm_roots.oops_do(oops, worker_id); + _weak_roots.oops_do<OopClosure>(oops, worker_id); + _dedup_roots.oops_do(&always_true, oops, worker_id); ! // Process heavy-weight/fully parallel roots the last _cld_roots.cld_do(&adjust_cld_closure, worker_id); _code_roots.code_blobs_do(adjust_code_closure, worker_id); ! _thread_roots.oops_do(oops, NULL, worker_id); } ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() : ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots), _serial_roots(ShenandoahPhaseTimings::heap_iteration_roots),
*** 261,277 **** // Must use _claim_none to avoid interfering with concurrent CLDG iteration CLDToOopClosure clds(oops, ClassLoaderData::_claim_none); MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations); ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL); AlwaysTrueClosure always_true; ResourceMark rm; _serial_roots.oops_do(oops, 0); - _vm_roots.oops_do(oops, 0); - _cld_roots.cld_do(&clds, 0); - _thread_roots.threads_do(&tc_cl, 0); - _code_roots.code_blobs_do(&code, 0); - _serial_weak_roots.weak_oops_do(oops, 0); _weak_roots.oops_do<OopClosure>(oops, 0); _dedup_roots.oops_do(&always_true, oops, 0); } --- 267,288 ---- // Must use _claim_none to avoid interfering with concurrent CLDG iteration CLDToOopClosure clds(oops, ClassLoaderData::_claim_none); MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations); ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL); AlwaysTrueClosure always_true; + ResourceMark rm; + // Process serial-claiming roots first _serial_roots.oops_do(oops, 0); _serial_weak_roots.weak_oops_do(oops, 0); + + // Process light-weight/limited parallel roots then + _vm_roots.oops_do(oops, 0); _weak_roots.oops_do<OopClosure>(oops, 0); _dedup_roots.oops_do(&always_true, oops, 0); + + // Process heavy-weight/fully parallel roots the last + _cld_roots.cld_do(&clds, 0); + _code_roots.code_blobs_do(&code, 0); + _thread_roots.threads_do(&tc_cl, 0); }
< prev index next >