8246591: Shenandoah: move string dedup roots scanning to concurrent phase

Reviewed-by: shade
This commit is contained in:
Zhengyu Gu 2020-06-10 08:34:10 -04:00
parent f3c2a17a30
commit d36a55d2ac
3 changed files with 5 additions and 7 deletions

View File

@ -199,8 +199,7 @@ ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase p
ShenandoahRootScanner::ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootScanner::ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase) :
ShenandoahRootProcessor(phase), ShenandoahRootProcessor(phase),
_serial_roots(phase), _serial_roots(phase),
_thread_roots(phase, n_workers > 1), _thread_roots(phase, n_workers > 1) {
_dedup_roots(phase) {
nmethod::oops_do_marking_prologue(); nmethod::oops_do_marking_prologue();
} }
@ -234,9 +233,6 @@ void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops, CLDClosur
// Process serial-claiming roots first // Process serial-claiming roots first
_serial_roots.oops_do(oops, worker_id); _serial_roots.oops_do(oops, worker_id);
// Process light-weight/limited parallel roots then
_dedup_roots.oops_do(&always_true, oops, worker_id);
// Process heavy-weight/fully parallel roots the last // Process heavy-weight/fully parallel roots the last
_thread_roots.threads_do(&tc_cl, worker_id); _thread_roots.threads_do(&tc_cl, worker_id);
} }

View File

@ -261,7 +261,6 @@ class ShenandoahRootScanner : public ShenandoahRootProcessor {
private: private:
ShenandoahSerialRoots _serial_roots; ShenandoahSerialRoots _serial_roots;
ShenandoahThreadRoots _thread_roots; ShenandoahThreadRoots _thread_roots;
ShenandoahStringDedupRoots _dedup_roots;
public: public:
ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase); ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase);
@ -284,6 +283,7 @@ private:
ShenandoahVMRoots<CONCURRENT> _vm_roots; ShenandoahVMRoots<CONCURRENT> _vm_roots;
ShenandoahClassLoaderDataRoots<CONCURRENT, false /* single-threaded*/> ShenandoahClassLoaderDataRoots<CONCURRENT, false /* single-threaded*/>
_cld_roots; _cld_roots;
ShenandoahConcurrentStringDedupRoots _dedup_roots;
ShenandoahNMethodTableSnapshot* _codecache_snapshot; ShenandoahNMethodTableSnapshot* _codecache_snapshot;
ShenandoahPhaseTimings::Phase _phase; ShenandoahPhaseTimings::Phase _phase;

View File

@ -189,6 +189,7 @@ ShenandoahConcurrentRootScanner<CONCURRENT>::ShenandoahConcurrentRootScanner(uin
ShenandoahPhaseTimings::Phase phase) : ShenandoahPhaseTimings::Phase phase) :
_vm_roots(phase), _vm_roots(phase),
_cld_roots(phase, n_workers), _cld_roots(phase, n_workers),
_dedup_roots(phase),
_codecache_snapshot(NULL), _codecache_snapshot(NULL),
_phase(phase) { _phase(phase) {
if (!ShenandoahHeap::heap()->unload_classes()) { if (!ShenandoahHeap::heap()->unload_classes()) {
@ -219,8 +220,9 @@ void ShenandoahConcurrentRootScanner<CONCURRENT>::oops_do(OopClosure* oops, uint
_vm_roots.oops_do(oops, worker_id); _vm_roots.oops_do(oops, worker_id);
if (!heap->unload_classes()) { if (!heap->unload_classes()) {
AlwaysTrueClosure always_true;
_cld_roots.cld_do(&clds_cl, worker_id); _cld_roots.cld_do(&clds_cl, worker_id);
_dedup_roots.oops_do(&always_true, oops, worker_id);
ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CodeCacheRoots, worker_id); ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CodeCacheRoots, worker_id);
CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations); CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations);
_codecache_snapshot->parallel_blobs_do(&blobs); _codecache_snapshot->parallel_blobs_do(&blobs);