Skip to content
Permalink
Browse files
8246612: Shenandoah: add timing tracking to ShenandoahStringDedupRoots
Reviewed-by: shade
  • Loading branch information
zhengyu123 committed Jun 4, 2020
1 parent 9cadf1a commit 1b59097077f2a39ee53bb250fe8f3043e2e60039
Showing 3 changed files with 18 additions and 5 deletions.
@@ -1663,7 +1663,8 @@ class ShenandoahConcurrentRootsEvacUpdateTask : public AbstractGangTask {
ShenandoahConcurrentRootsEvacUpdateTask(ShenandoahPhaseTimings::Phase phase) :
AbstractGangTask("Shenandoah Evacuate/Update Concurrent Strong Roots Task"),
_vm_roots(phase),
_cld_roots(phase, ShenandoahHeap::heap()->workers()->active_workers()) {}
_cld_roots(phase, ShenandoahHeap::heap()->workers()->active_workers()),
_dedup_roots(phase) {}

void work(uint worker_id) {
ShenandoahConcurrentWorkerSession worker_session(worker_id);
@@ -149,7 +149,8 @@ void ShenandoahStringDedupRoots::oops_do(BoolObjectClosure* is_alive, OopClosure
}
}

ShenandoahConcurrentStringDedupRoots::ShenandoahConcurrentStringDedupRoots() {
ShenandoahConcurrentStringDedupRoots::ShenandoahConcurrentStringDedupRoots(ShenandoahPhaseTimings::Phase phase) :
_phase(phase) {
if (ShenandoahStringDedup::is_enabled()) {
StringDedupTable_lock->lock_without_safepoint_check();
StringDedupQueue_lock->lock_without_safepoint_check();
@@ -171,8 +172,15 @@ void ShenandoahConcurrentStringDedupRoots::oops_do(BoolObjectClosure* is_alive,
assert_locked_or_safepoint_weak(StringDedupTable_lock);

StringDedupUnlinkOrOopsDoClosure sd_cl(is_alive, keep_alive);
StringDedupQueue::unlink_or_oops_do(&sd_cl);
StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
{
ShenandoahWorkerTimingsTracker x(_phase, ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id);
StringDedupQueue::unlink_or_oops_do(&sd_cl);
}

{
ShenandoahWorkerTimingsTracker x(_phase, ShenandoahPhaseTimings::StringDedupTableRoots, worker_id);
StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id);
}
}
}

@@ -360,6 +368,7 @@ ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() :
_cld_roots(ShenandoahPhaseTimings::heap_iteration_roots, 1),
_serial_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_dedup_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
}

@@ -205,8 +205,11 @@ class ShenandoahStringDedupRoots {
};

class ShenandoahConcurrentStringDedupRoots {
private:
ShenandoahPhaseTimings::Phase _phase;

public:
ShenandoahConcurrentStringDedupRoots();
ShenandoahConcurrentStringDedupRoots(ShenandoahPhaseTimings::Phase phase);
~ShenandoahConcurrentStringDedupRoots();

void oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id);

0 comments on commit 1b59097

Please sign in to comment.