Skip to content

Commit b8c9d6c

Browse files
committed
8302158: PPC: test/jdk/jdk/internal/vm/Continuation/Fuzz.java: AssertionError: res: false shouldPin: false
Reviewed-by: goetz, mdoerr
1 parent dc55a7f commit b8c9d6c

File tree

3 files changed

+194
-55
lines changed

3 files changed

+194
-55
lines changed

src/hotspot/cpu/ppc/frame_ppc.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,12 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
421421
#endif
422422

423423
intptr_t *frame::initial_deoptimization_info() {
424-
// unused... but returns fp() to minimize changes introduced by 7087445
425-
return fp();
424+
// `this` is the caller of the deoptee. We want to trim it, if compiled, to
425+
// unextended_sp. This is necessary if the deoptee frame is the bottom frame
426+
// of a continuation on stack (more frames could be in a StackChunk) as it
427+
// will pop its stack args. Otherwise the recursion in
428+
// FreezeBase::recurse_freeze_java_frame() would not stop at the bottom frame.
429+
return is_compiled_frame() ? unextended_sp() : sp();
426430
}
427431

428432
#ifndef PRODUCT

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,13 @@ void SharedRuntime::generate_deopt_blob() {
30923092

30933093
// stack: (caller_of_deoptee, ...).
30943094

3095+
// Freezing continuation frames requires that the caller is trimmed to unextended sp if compiled.
3096+
// If not compiled the loaded value is equal to the current SP (see frame::initial_deoptimization_info())
3097+
// and the frame is effectively not resized.
3098+
Register caller_sp = R23_tmp3;
3099+
__ ld_ptr(caller_sp, Deoptimization::UnrollBlock::initial_info_offset_in_bytes(), unroll_block_reg);
3100+
__ resize_frame_absolute(caller_sp, R24_tmp4, R25_tmp5);
3101+
30953102
// Loop through the `UnrollBlock' info and create interpreter frames.
30963103
push_skeleton_frames(masm, true/*deopt*/,
30973104
unroll_block_reg,
@@ -3227,6 +3234,13 @@ void SharedRuntime::generate_uncommon_trap_blob() {
32273234
__ asm_assert_eq("SharedRuntime::generate_deopt_blob: expected Unpack_uncommon_trap");
32283235
#endif
32293236

3237+
// Freezing continuation frames requires that the caller is trimmed to unextended sp if compiled.
3238+
// If not compiled the loaded value is equal to the current SP (see frame::initial_deoptimization_info())
3239+
// and the frame is effectively not resized.
3240+
Register caller_sp = R23_tmp3;
3241+
__ ld_ptr(caller_sp, Deoptimization::UnrollBlock::initial_info_offset_in_bytes(), unroll_block_reg);
3242+
__ resize_frame_absolute(caller_sp, R24_tmp4, R25_tmp5);
3243+
32303244
// Allocate new interpreter frame(s) and possibly a c2i adapter
32313245
// frame.
32323246
push_skeleton_frames(masm, false/*deopt*/,

0 commit comments

Comments
 (0)