Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8287901: Loom: Failures with -XX:+VerifyStack
Reviewed-by: pchilanomate, coleenp
  • Loading branch information
pron authored and pchilano committed Jun 8, 2022
1 parent 04f02ac commit b623398
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
22 changes: 15 additions & 7 deletions src/hotspot/cpu/aarch64/frame_aarch64.cpp
Expand Up @@ -606,13 +606,21 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);
}

intptr_t* ret_pc_loc = sp() - return_addr_offset;
address ret_pc = *(address*)ret_pc_loc;
if (Continuation::is_return_barrier_entry(ret_pc))
values.describe(frame_no, ret_pc_loc, "return address (return barrier)");
else
values.describe(frame_no, ret_pc_loc, err_msg("return address for #%d", frame_no));
values.describe(frame_no, sp() - sender_sp_offset, err_msg("saved fp for #%d", frame_no), 0);
if (is_java_frame() || Continuation::is_continuation_enterSpecial(*this)) {
intptr_t* ret_pc_loc;
intptr_t* fp_loc;
if (is_interpreted_frame()) {
ret_pc_loc = fp() + return_addr_offset;
fp_loc = fp();
} else {
ret_pc_loc = real_fp() - return_addr_offset;
fp_loc = real_fp() - sender_sp_offset;
}
address ret_pc = *(address*)ret_pc_loc;
values.describe(frame_no, ret_pc_loc,
Continuation::is_return_barrier_entry(ret_pc) ? "return address (return barrier)" : "return address");
values.describe(-1, fp_loc, "saved fp", 0); // "unowned" as value belongs to sender
}
}
#endif

Expand Down
22 changes: 15 additions & 7 deletions src/hotspot/cpu/x86/frame_x86.cpp
Expand Up @@ -619,13 +619,21 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
#endif // AMD64
}

intptr_t* ret_pc_loc = sp() - return_addr_offset;
address ret_pc = *(address*)ret_pc_loc;
if (Continuation::is_return_barrier_entry(ret_pc))
values.describe(frame_no, ret_pc_loc, "return address (return barrier)");
else
values.describe(frame_no, ret_pc_loc, err_msg("return address for #%d", frame_no));
values.describe(frame_no, sp() - sender_sp_offset, err_msg("saved fp for #%d", frame_no), 0);
if (is_java_frame() || Continuation::is_continuation_enterSpecial(*this)) {
intptr_t* ret_pc_loc;
intptr_t* fp_loc;
if (is_interpreted_frame()) {
ret_pc_loc = fp() + return_addr_offset;
fp_loc = fp();
} else {
ret_pc_loc = real_fp() - return_addr_offset;
fp_loc = real_fp() - sender_sp_offset;
}
address ret_pc = *(address*)ret_pc_loc;
values.describe(frame_no, ret_pc_loc,
Continuation::is_return_barrier_entry(ret_pc) ? "return address (return barrier)" : "return address");
values.describe(-1, fp_loc, "saved fp", 0); // "unowned" as value belongs to sender
}
}

#endif // !PRODUCT
Expand Down
11 changes: 11 additions & 0 deletions test/jdk/jdk/internal/vm/Continuation/Basic.java
Expand Up @@ -37,7 +37,18 @@
* @run testng/othervm --enable-preview -Xcomp -XX:-TieredCompilation -XX:CompileOnly=jdk/internal/vm/Continuation,Basic -XX:CompileCommand=exclude,Basic.manyArgsDriver Basic
* @run testng/othervm --enable-preview -Xcomp -XX:-TieredCompilation -XX:CompileOnly=jdk/internal/vm/Continuation,Basic -XX:CompileCommand=exclude,jdk/internal/vm/Continuation.enter Basic
* @run testng/othervm --enable-preview -Xcomp -XX:-TieredCompilation -XX:CompileOnly=jdk/internal/vm/Continuation,Basic -XX:CompileCommand=inline,jdk/internal/vm/Continuation.run Basic
*/

/**
* @test
* @requires vm.continuations
* @requires vm.debug
* @modules java.base/jdk.internal.vm
* @build java.base/java.lang.StackWalkerHelper
*
* @run testng/othervm --enable-preview -XX:+VerifyStack -Xint Basic
* @run testng/othervm --enable-preview -XX:+VerifyStack -Xcomp -XX:TieredStopAtLevel=3 -XX:CompileOnly=jdk/internal/vm/Continuation,Basic Basic
* @run testng/othervm --enable-preview -XX:+VerifyStack -Xcomp -XX:-TieredCompilation -XX:CompileOnly=jdk/internal/vm/Continuation,Basic Basic
*/

import jdk.internal.vm.Continuation;
Expand Down

0 comments on commit b623398

Please sign in to comment.