8231293: Shenandoah: Traversal should not revive dead weak roots
Reviewed-by: shade
This commit is contained in:
parent
8551294077
commit
470168868f
src/hotspot/share/gc/shenandoah
@ -266,9 +266,19 @@ oop ShenandoahBarrierSet::oop_load_from_native_barrier(oop obj) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (_heap->is_evacuation_in_progress() &&
|
||||
!_heap->complete_marking_context()->is_marked(obj)) {
|
||||
return NULL;
|
||||
ShenandoahMarkingContext* const marking_context = _heap->marking_context();
|
||||
|
||||
if (_heap->is_evacuation_in_progress()) {
|
||||
// Normal GC
|
||||
if (!marking_context->is_marked(obj)) {
|
||||
return NULL;
|
||||
}
|
||||
} else if (_heap->is_concurrent_traversal_in_progress()) {
|
||||
// Traversal GC
|
||||
if (marking_context->is_complete() &&
|
||||
!marking_context->is_marked(resolve_forwarded_not_null(obj))) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return load_reference_barrier_not_null(obj);
|
||||
|
@ -593,11 +593,6 @@ void ShenandoahTraversalGC::final_traversal_collection() {
|
||||
weak_refs_work();
|
||||
}
|
||||
|
||||
if (!_heap->cancelled_gc()) {
|
||||
fixup_roots();
|
||||
_heap->parallel_cleaning(false);
|
||||
}
|
||||
|
||||
if (!_heap->cancelled_gc()) {
|
||||
assert(_task_queues->is_empty(), "queues must be empty after traversal GC");
|
||||
TASKQUEUE_STATS_ONLY(_task_queues->print_taskqueue_stats());
|
||||
@ -606,6 +601,9 @@ void ShenandoahTraversalGC::final_traversal_collection() {
|
||||
// No more marking expected
|
||||
_heap->mark_complete_marking_context();
|
||||
|
||||
fixup_roots();
|
||||
_heap->parallel_cleaning(false);
|
||||
|
||||
// Resize metaspace
|
||||
MetaspaceGC::compute_new_size();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user