--- old/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp 2020-06-01 12:25:22.525029055 +0200 +++ new/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp 2020-06-01 12:25:22.213029460 +0200 @@ -202,7 +202,7 @@ _code_roots(phase), _vm_roots(phase), _dedup_roots(phase), - _cld_roots(phase) { + _cld_roots(phase, n_workers) { } void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops) { @@ -234,9 +234,9 @@ // 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 - _cld_roots.cld_do(clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } @@ -251,9 +251,9 @@ // 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 - _cld_roots.always_strong_cld_do(clds, worker_id); _thread_roots.threads_do(&tc_cl, worker_id); } @@ -264,7 +264,7 @@ ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), - _cld_roots(phase), + _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), @@ -292,11 +292,13 @@ _weak_roots.oops_do(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); + } + + // 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 { @@ -308,7 +310,7 @@ ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), - _cld_roots(phase), + _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), @@ -320,7 +322,7 @@ ShenandoahRootProcessor(phase), _serial_roots(phase), _vm_roots(phase), - _cld_roots(phase), + _cld_roots(phase, n_workers), _thread_roots(phase, n_workers > 1), _serial_weak_roots(phase), _weak_roots(phase), @@ -346,9 +348,9 @@ _vm_roots.oops_do(oops, worker_id); _weak_roots.oops_do(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 - _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); } @@ -358,7 +360,7 @@ _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), + _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) { @@ -382,9 +384,9 @@ _vm_roots.oops_do(oops, 0); _weak_roots.oops_do(oops, 0); _dedup_roots.oops_do(&always_true, oops, 0); + _cld_roots.cld_do(&clds, 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); }