< prev index next >
src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
Print this page
rev 54286 : 8221435: Shenandoah should not mark through weak roots
*** 186,202 ****
{
ShenandoahTraversalClosure roots_cl(q, rp);
ShenandoahMarkCLDClosure cld_cl(&roots_cl);
MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
if (unload_classes) {
! _rp->process_strong_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, NULL, NULL, NULL, worker_id);
// Need to pre-evac code roots here. Otherwise we might see from-space constants.
ShenandoahWorkerTimings* worker_times = _heap->phase_timings()->worker_times();
ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::CodeCacheRoots, worker_id);
_cset_coderoots->possibly_parallel_blobs_do(&code_cl);
} else {
! _rp->process_all_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, &code_cl, NULL, worker_id);
}
}
}
};
--- 186,202 ----
{
ShenandoahTraversalClosure roots_cl(q, rp);
ShenandoahMarkCLDClosure cld_cl(&roots_cl);
MarkingCodeBlobClosure code_cl(&roots_cl, CodeBlobToOopClosure::FixRelocations);
if (unload_classes) {
! _rp->process_strong_roots(&roots_cl, &cld_cl, NULL, NULL, NULL, worker_id);
// Need to pre-evac code roots here. Otherwise we might see from-space constants.
ShenandoahWorkerTimings* worker_times = _heap->phase_timings()->worker_times();
ShenandoahWorkerTimingsTracker timer(worker_times, ShenandoahPhaseTimings::CodeCacheRoots, worker_id);
_cset_coderoots->possibly_parallel_blobs_do(&code_cl);
} else {
! _rp->process_all_roots(&roots_cl, &cld_cl, &code_cl, NULL, worker_id);
}
}
}
};
*** 268,290 ****
ShenandoahTraversalClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
if (unload_classes) {
ShenandoahRemarkCLDClosure weak_cld_cl(&roots_cl);
! _rp->process_strong_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, &weak_cld_cl, NULL, &tc, worker_id);
} else {
! _rp->process_all_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, NULL, &tc, worker_id);
}
} else {
ShenandoahTraversalDegenClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
if (unload_classes) {
ShenandoahRemarkCLDClosure weak_cld_cl(&roots_cl);
! _rp->process_strong_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, &weak_cld_cl, NULL, &tc, worker_id);
} else {
! _rp->process_all_roots(&roots_cl, process_refs ? NULL : &roots_cl, &cld_cl, NULL, &tc, worker_id);
}
}
{
ShenandoahWorkerTimings *worker_times = _heap->phase_timings()->worker_times();
--- 268,290 ----
ShenandoahTraversalClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
if (unload_classes) {
ShenandoahRemarkCLDClosure weak_cld_cl(&roots_cl);
! _rp->process_strong_roots(&roots_cl, &cld_cl, &weak_cld_cl, NULL, &tc, worker_id);
} else {
! _rp->process_all_roots(&roots_cl, &cld_cl, NULL, &tc, worker_id);
}
} else {
ShenandoahTraversalDegenClosure roots_cl(q, rp);
CLDToOopClosure cld_cl(&roots_cl, ClassLoaderData::_claim_strong);
ShenandoahTraversalSATBThreadsClosure tc(&satb_cl);
if (unload_classes) {
ShenandoahRemarkCLDClosure weak_cld_cl(&roots_cl);
! _rp->process_strong_roots(&roots_cl, &cld_cl, &weak_cld_cl, NULL, &tc, worker_id);
} else {
! _rp->process_all_roots(&roots_cl, &cld_cl, NULL, &tc, worker_id);
}
}
{
ShenandoahWorkerTimings *worker_times = _heap->phase_timings()->worker_times();
*** 592,603 ****
if (!_heap->cancelled_gc() && _heap->process_references()) {
weak_refs_work();
}
! if (!_heap->cancelled_gc() && _heap->unload_classes()) {
_heap->unload_classes_and_cleanup_tables(false);
fixup_roots();
}
if (!_heap->cancelled_gc()) {
assert(_task_queues->is_empty(), "queues must be empty after traversal GC");
--- 592,606 ----
if (!_heap->cancelled_gc() && _heap->process_references()) {
weak_refs_work();
}
! if (!_heap->cancelled_gc()) {
! if (_heap->unload_classes()) {
_heap->unload_classes_and_cleanup_tables(false);
+ }
+
fixup_roots();
}
if (!_heap->cancelled_gc()) {
assert(_task_queues->is_empty(), "queues must be empty after traversal GC");
*** 696,706 ****
void work(uint worker_id) {
ShenandoahParallelWorkerSession worker_session(worker_id);
ShenandoahTraversalFixRootsClosure cl;
MarkingCodeBlobClosure blobsCl(&cl, CodeBlobToOopClosure::FixRelocations);
CLDToOopClosure cldCl(&cl, ClassLoaderData::_claim_strong);
! _rp->process_all_roots(&cl, &cl, &cldCl, &blobsCl, NULL, worker_id);
}
};
void ShenandoahTraversalGC::fixup_roots() {
#if defined(COMPILER2) || INCLUDE_JVMCI
--- 699,709 ----
void work(uint worker_id) {
ShenandoahParallelWorkerSession worker_session(worker_id);
ShenandoahTraversalFixRootsClosure cl;
MarkingCodeBlobClosure blobsCl(&cl, CodeBlobToOopClosure::FixRelocations);
CLDToOopClosure cldCl(&cl, ClassLoaderData::_claim_strong);
! _rp->traversal_update_all_roots(&cl, &cldCl, &blobsCl, NULL, worker_id);
}
};
void ShenandoahTraversalGC::fixup_roots() {
#if defined(COMPILER2) || INCLUDE_JVMCI
< prev index next >