8336944: Shenandoah: Should only relativize stack chunks for successful evacuations

Reviewed-by: shade, ysr
This commit is contained in:
William Kemper 2024-07-23 16:50:25 +00:00
parent 8efcb40c47
commit 2f2223d752

View File

@ -1178,11 +1178,10 @@ oop ShenandoahHeap::evacuate_object(oop p, Thread* thread) {
// Try to install the new forwarding pointer.
oop copy_val = cast_to_oop(copy);
ContinuationGCSupport::relativize_stack_chunk(copy_val);
oop result = ShenandoahForwarding::try_update_forwardee(p, copy_val);
if (result == copy_val) {
// Successfully evacuated. Our copy is now the public one!
ContinuationGCSupport::relativize_stack_chunk(copy_val);
shenandoah_assert_correct(nullptr, copy_val);
return copy_val;
} else {