From 4fbf272017d2f6933e66f8a67cb88e3ffc42339e Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Thu, 21 Nov 2024 02:05:00 +0000 Subject: [PATCH] 8344526: RISC-V: implement -XX:+VerifyActivationFrameSize Co-authored-by: Fei Yang Reviewed-by: mli, fyang --- src/hotspot/cpu/riscv/interp_masm_riscv.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp index b00b4474d69..897222ef995 100644 --- a/src/hotspot/cpu/riscv/interp_masm_riscv.cpp +++ b/src/hotspot/cpu/riscv/interp_masm_riscv.cpp @@ -441,7 +441,14 @@ void InterpreterMacroAssembler::dispatch_base(TosState state, Register Rs) { // Pay attention to the argument Rs, which is acquiesce in t0. if (VerifyActivationFrameSize) { - Unimplemented(); + Label L; + sub(t1, fp, esp); + int min_frame_size = + (frame::link_offset - frame::interpreter_frame_initial_sp_offset + frame::metadata_words) * wordSize; + sub(t1, t1, min_frame_size); + bgez(t1, L); + stop("broken stack frame"); + bind(L); } if (verifyoop && state == atos) { verify_oop(x10);