diff --git a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp index 44b9f59bbb390..366c2aee79b18 100644 --- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp @@ -551,7 +551,9 @@ void InterpreterMacroAssembler::remove_activation( br(Assembler::AL, fast_path); bind(slow_path); push(state); - call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_unwind)); + set_last_Java_frame(esp, rfp, pc(), rscratch1); + super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::at_unwind), rthread); + reset_last_Java_frame(true); pop(state); bind(fast_path); diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index 2c7f861b1a2e0..08c35745c67bb 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp @@ -999,7 +999,9 @@ void InterpreterMacroAssembler::remove_activation( jmp(fast_path); bind(slow_path); push(state); - call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_unwind)); + set_last_Java_frame(noreg, rbp, pc()); + super_call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::at_unwind), rthread); + reset_last_Java_frame(rthread, true); pop(state); NOT_LP64(get_thread(rthread);) // call_VM clobbered it, restore bind(fast_path); diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 40c7d09800934..067774af20fa2 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -1172,7 +1172,7 @@ JRT_ENTRY(void, InterpreterRuntime::at_safepoint(JavaThread* thread)) } JRT_END -JRT_ENTRY(void, InterpreterRuntime::at_unwind(JavaThread* thread)) +JRT_LEAF(void, InterpreterRuntime::at_unwind(JavaThread* thread)) // JRT_END does an implicit safepoint check, hence we are guaranteed to block // if this is called during a safepoint