Skip to content

Commit

Permalink
8285595: Assert frame anchor doesn't change in safepoints/handshakes
Browse files Browse the repository at this point in the history
Reviewed-by: rehn, coleenp
  • Loading branch information
pron authored and robehn committed Apr 28, 2022
1 parent 5629c75 commit d7514b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/runtime/safepointMechanism.cpp
Expand Up @@ -112,6 +112,7 @@ void SafepointMechanism::update_poll_values(JavaThread* thread) {
}

void SafepointMechanism::process(JavaThread *thread, bool allow_suspend, bool check_async_exception) {
DEBUG_ONLY(intptr_t* sp_before = thread->last_Java_sp();)
// Read global poll and has_handshake after local poll
OrderAccess::loadload();

Expand Down Expand Up @@ -140,6 +141,7 @@ void SafepointMechanism::process(JavaThread *thread, bool allow_suspend, bool ch

update_poll_values(thread);
OrderAccess::cross_modify_fence();
assert(sp_before == thread->last_Java_sp(), "Anchor has changed");
}

void SafepointMechanism::initialize_header(JavaThread* thread) {
Expand Down

1 comment on commit d7514b0

@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.