Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8306734: Shenandoah: Missing barriers on deoptimization path
Backport-of: 28829f308fe6314388c9a47b91273bcf81eb806c
  • Loading branch information
shipilev committed May 1, 2023
1 parent 63da061 commit 2654070
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/hotspot/share/runtime/stackValue.cpp
Expand Up @@ -80,7 +80,19 @@ static oop oop_from_oop_location(stackChunkOop chunk, void* addr) {
}

// Load oop from stack
return *(oop*)addr;
oop val = *(oop*)addr;

#if INCLUDE_SHENANDOAHGC
if (UseShenandoahGC) {
// Pass the value through the barrier to avoid capturing bad oops as
// stack values. Note: do not heal the location, to avoid accidentally
// corrupting the stack. Stack watermark barriers are supposed to handle
// the healing.
val = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val);
}
#endif

return val;
}

static oop oop_from_narrowOop_location(stackChunkOop chunk, void* addr, bool is_register) {
Expand All @@ -105,7 +117,19 @@ static oop oop_from_narrowOop_location(stackChunkOop chunk, void* addr, bool is_
}

// Load oop from stack
return CompressedOops::decode(*narrow_addr);
oop val = CompressedOops::decode(*narrow_addr);

#if INCLUDE_SHENANDOAHGC
if (UseShenandoahGC) {
// Pass the value through the barrier to avoid capturing bad oops as
// stack values. Note: do not heal the location, to avoid accidentally
// corrupting the stack. Stack watermark barriers are supposed to handle
// the healing.
val = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val);
}
#endif

return val;
}

StackValue* StackValue::create_stack_value_from_oop_location(stackChunkOop chunk, void* addr) {
Expand Down

1 comment on commit 2654070

@openjdk-notifier
Copy link

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.