Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8258714: Shenandoah: Process references before evacuation during degen
Reviewed-by: shade
  • Loading branch information
rkennke committed Dec 21, 2020
1 parent e680ebe commit 2525f39d35b7ce556418812613b7cc35d03c1dc6
Showing 5 changed files with 15 additions and 7 deletions.
@@ -2055,6 +2055,15 @@ void ShenandoahHeap::op_weak_refs() {
}
}

void ShenandoahHeap::stw_weak_refs(bool full_gc) {
// Weak refs processing
ShenandoahTimingsTracker t(full_gc ? ShenandoahPhaseTimings::full_gc_weakrefs_process
: ShenandoahPhaseTimings::degen_gc_weakrefs_process);
ShenandoahGCWorkerPhase worker_phase(full_gc ? ShenandoahPhaseTimings::full_gc_weakrefs_process
: ShenandoahPhaseTimings::degen_gc_weakrefs_process);
ref_processor()->process_references(workers(), false /* concurrent */);
}

void ShenandoahHeap::op_weak_roots() {
if (is_concurrent_weak_root_in_progress()) {
// Concurrent weak root processing
@@ -2194,12 +2203,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) {
ShenandoahCodeRoots::disarm_nmethods();
}

{
ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_refs_work);
ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_refs_work);
ref_processor()->process_references(workers(), false /* concurrent */);
}

op_cleanup_early();

case _degenerated_evac:
@@ -2485,6 +2488,7 @@ void ShenandoahHeap::stw_process_weak_roots(bool full_gc) {
void ShenandoahHeap::parallel_cleaning(bool full_gc) {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
assert(is_stw_gc_in_progress(), "Only for Degenerated and Full GC");
stw_weak_refs(full_gc);
stw_process_weak_roots(full_gc);
stw_unload_classes(full_gc);
}
@@ -515,6 +515,7 @@ class ShenandoahHeap : public CollectedHeap {
private:
void stw_unload_classes(bool full_gc);
void stw_process_weak_roots(bool full_gc);
void stw_weak_refs(bool full_gc);

// Prepare concurrent root processing
void prepare_concurrent_roots();
@@ -249,7 +249,6 @@ void ShenandoahMarkCompact::phase1_mark_heap() {
cm->mark_roots(ShenandoahPhaseTimings::full_gc_scan_roots);
cm->finish_mark_from_roots(/* full_gc = */ true);
heap->mark_complete_marking_context();
rp->process_references(heap->workers(), false /* concurrent */);
heap->parallel_cleaning(true /* full_gc */);
}

@@ -105,9 +105,11 @@ bool ShenandoahPhaseTimings::is_worker_phase(Phase phase) {
case full_gc_adjust_roots:
case degen_gc_scan_conc_roots:
case degen_gc_update_roots:
case full_gc_weakrefs_process:
case full_gc_scan_conc_roots:
case full_gc_purge_class_unload:
case full_gc_purge_weak_par:
case degen_gc_weakrefs_process:
case degen_gc_purge_class_unload:
case degen_gc_purge_weak_par:
case heap_iteration_roots:
@@ -118,6 +118,8 @@ class outputStream;
f(degen_gc, "Pause Degenerated GC (N)") \
f(degen_gc_scan_conc_roots, " Degen Mark Roots") \
SHENANDOAH_PAR_PHASE_DO(degen_gc_conc_mark_, " DM: ", f) \
f(degen_gc_weakrefs, " Weak References") \
f(degen_gc_weakrefs_process, " Process") \
f(degen_gc_purge, " System Purge") \
f(degen_gc_purge_class_unload, " Unload Classes") \
SHENANDOAH_PAR_PHASE_DO(degen_gc_purge_cu_par_, " DCU: ", f) \

1 comment on commit 2525f39

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 2525f39 Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.