Skip to content

Commit 5a259d8

Browse files
fbredbercoleenp
authored andcommitted
8303153: Native interpreter frame missing mirror
Reviewed-by: coleenp, fyang
1 parent 4b02956 commit 5a259d8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
884884
// Make sure there is room for the exception oop pushed in case method throws
885885
// an exception (see TemplateInterpreterGenerator::generate_throw_exception())
886886
__ sub(rscratch1, sp, 2 * wordSize);
887-
__ stp(zr, rscratch1, Address(sp, 4 * wordSize));
887+
__ stp(r10, rscratch1, Address(sp, 4 * wordSize));
888888
__ mov(sp, rscratch1);
889889
}
890890
}

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,26 +770,26 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
770770
__ sd(x19_sender_sp, Address(sp, 9 * wordSize));
771771
__ sd(zr, Address(sp, 8 * wordSize));
772772

773-
// Get mirror
773+
// Get mirror and store it in the frame as GC root for this Method*
774774
__ load_mirror(t2, xmethod, x15, t1);
775+
__ sd(t2, Address(sp, 4 * wordSize));
776+
775777
if (!native_call) {
776778
__ ld(t0, Address(xmethod, Method::const_offset()));
777779
__ lhu(t0, Address(t0, ConstMethod::max_stack_offset()));
778780
__ add(t0, t0, MAX2(3, Method::extra_stack_entries()));
779781
__ slli(t0, t0, 3);
780782
__ sub(t0, sp, t0);
781783
__ andi(t0, t0, -16);
782-
// Store extended SP and mirror
784+
// Store extended SP
783785
__ sd(t0, Address(sp, 5 * wordSize));
784-
__ sd(t2, Address(sp, 4 * wordSize));
785786
// Move SP out of the way
786787
__ mv(sp, t0);
787788
} else {
788789
// Make sure there is room for the exception oop pushed in case method throws
789790
// an exception (see TemplateInterpreterGenerator::generate_throw_exception())
790791
__ sub(t0, sp, 2 * wordSize);
791792
__ sd(t0, Address(sp, 5 * wordSize));
792-
__ sd(zr, Address(sp, 4 * wordSize));
793793
__ mv(sp, t0);
794794
}
795795
}

0 commit comments

Comments
 (0)