< prev index next >

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

Print this page
rev 59532 : 8246100: Shenandoah: walk roots in more efficient order
Reviewed-by: XXX
rev 59533 : 8246097: Shenandoah: limit parallelism in CLDG root handling
Reviewed-by: XXX

*** 200,210 **** _serial_roots(phase), _thread_roots(phase, n_workers > 1), _code_roots(phase), _vm_roots(phase), _dedup_roots(phase), ! _cld_roots(phase) { } void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops) { CLDToOopClosure clds_cl(oops, ClassLoaderData::_claim_strong); MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations); --- 200,210 ---- _serial_roots(phase), _thread_roots(phase, n_workers > 1), _code_roots(phase), _vm_roots(phase), _dedup_roots(phase), ! _cld_roots(phase, n_workers) { } void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops) { CLDToOopClosure clds_cl(oops, ClassLoaderData::_claim_strong); MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations);
*** 232,244 **** _serial_roots.oops_do(oops, worker_id); // Process light-weight/limited parallel roots then _vm_roots.oops_do(oops, worker_id); _dedup_roots.oops_do(&always_true, oops, worker_id); // Process heavy-weight/fully parallel roots the last - _cld_roots.cld_do(clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } void ShenandoahRootScanner::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) { assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading"); --- 232,244 ---- _serial_roots.oops_do(oops, worker_id); // Process light-weight/limited parallel roots then _vm_roots.oops_do(oops, worker_id); _dedup_roots.oops_do(&always_true, oops, worker_id); + _cld_roots.cld_do(clds, worker_id); // Process heavy-weight/fully parallel roots the last _thread_roots.threads_do(&tc_cl, worker_id); } void ShenandoahRootScanner::strong_roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure* tc) { assert(ShenandoahHeap::heap()->unload_classes(), "Should be used during class unloading");
*** 249,272 **** // Process serial-claiming roots first _serial_roots.oops_do(oops, worker_id); // Process light-weight/limited parallel roots then _vm_roots.oops_do(oops, worker_id); // Process heavy-weight/fully parallel roots the last - _cld_roots.always_strong_cld_do(clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } ShenandoahRootEvacuator::ShenandoahRootEvacuator(uint n_workers, ShenandoahPhaseTimings::Phase phase, bool stw_roots_processing, bool stw_class_unloading) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase), --- 249,272 ---- // Process serial-claiming roots first _serial_roots.oops_do(oops, worker_id); // Process light-weight/limited parallel roots then _vm_roots.oops_do(oops, worker_id); + _cld_roots.always_strong_cld_do(clds, worker_id); // Process heavy-weight/fully parallel roots the last _thread_roots.threads_do(&tc_cl, worker_id); } ShenandoahRootEvacuator::ShenandoahRootEvacuator(uint n_workers, ShenandoahPhaseTimings::Phase phase, bool stw_roots_processing, bool stw_class_unloading) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase),
*** 290,304 **** 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); } --- 290,306 ---- 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); } if (_stw_class_unloading) { CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong); _cld_roots.cld_do(&clds, worker_id); + } + + // Process heavy-weight/fully parallel roots the last + if (_stw_class_unloading) { _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); }
*** 306,316 **** ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase) { --- 308,318 ---- ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase) {
*** 318,328 **** ShenandoahRootAdjuster::ShenandoahRootAdjuster(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase) { --- 320,330 ---- ShenandoahRootAdjuster::ShenandoahRootAdjuster(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), ! _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), _dedup_roots(phase), _code_roots(phase) {
*** 344,366 **** // 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), _thread_roots(ShenandoahPhaseTimings::heap_iteration_roots, false /*is par*/), _vm_roots(ShenandoahPhaseTimings::heap_iteration_roots), ! _cld_roots(ShenandoahPhaseTimings::heap_iteration_roots), _serial_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), _weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), _code_roots(ShenandoahPhaseTimings::heap_iteration_roots) { } --- 346,368 ---- // 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); + _cld_roots.cld_do(&adjust_cld_closure, worker_id); // Process heavy-weight/fully parallel roots the last _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), _thread_roots(ShenandoahPhaseTimings::heap_iteration_roots, false /*is par*/), _vm_roots(ShenandoahPhaseTimings::heap_iteration_roots), ! _cld_roots(ShenandoahPhaseTimings::heap_iteration_roots, 1), _serial_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), _weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), _code_roots(ShenandoahPhaseTimings::heap_iteration_roots) { }
*** 380,390 **** // 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); } --- 382,392 ---- // 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); + _cld_roots.cld_do(&clds, 0); // Process heavy-weight/fully parallel roots the last _code_roots.code_blobs_do(&code, 0); _thread_roots.threads_do(&tc_cl, 0); }
< prev index next >