From 42dc6b5d3a620c208717d875eb4caa5dc74013f2 Mon Sep 17 00:00:00 2001 From: Feilong Jiang Date: Fri, 15 Sep 2023 10:04:43 +0000 Subject: [PATCH] 8316182: RISC-V: SA stack walking code having trouble finding sender frame when invoking LambdaForms is involved Reviewed-by: fyang --- .../hotspot/runtime/riscv64/RISCV64Frame.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java index 90d070112db..b21a163e970 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/riscv64/RISCV64Frame.java @@ -322,24 +322,17 @@ public class RISCV64Frame extends Frame { //------------------------------------------------------------------------------ // frame::adjust_unextended_sp private void adjustUnextendedSP() { - // If we are returning to a compiled MethodHandle call site, the - // saved_fp will in fact be a saved value of the unextended SP. The - // simplest way to tell whether we are returning to such a call site - // is as follows: + // Sites calling method handle intrinsics and lambda forms are + // treated as any other call site. Therefore, no special action is + // needed when we are returning to any of these call sites. CodeBlob cb = cb(); NMethod senderNm = (cb == null) ? null : cb.asNMethodOrNull(); if (senderNm != null) { - // If the sender PC is a deoptimization point, get the original - // PC. For MethodHandle call site the unextended_sp is stored in - // saved_fp. - if (senderNm.isDeoptMhEntry(getPC())) { - raw_unextendedSP = getFP(); - } - else if (senderNm.isDeoptEntry(getPC())) { - } - else if (senderNm.isMethodHandleReturn(getPC())) { - raw_unextendedSP = getFP(); + // If the sender PC is a deoptimization point, get the original PC. + if (senderNm.isDeoptEntry(getPC()) || + senderNm.isDeoptMhEntry(getPC())) { + // DEBUG_ONLY(verifyDeoptriginalPc(senderNm, raw_unextendedSp)); } } }