From d08100fadb5634352b000040fb7024a86e884b69 Mon Sep 17 00:00:00 2001 From: zifeihan Date: Sun, 4 Aug 2024 10:38:14 +0800 Subject: [PATCH] JDK-8337788: RISC-V: Cleanup code in MacroAssembler::reserved_stack_check --- .../cpu/riscv/macroAssembler_riscv.cpp | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index cd7a4ecf22803..e0b24b7fd66ca 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -4130,29 +4130,25 @@ void MacroAssembler::remove_frame(int framesize) { } void MacroAssembler::reserved_stack_check() { - // testing if reserved zone needs to be enabled - Label no_reserved_zone_enabling; + // testing if reserved zone needs to be enabled + Label no_reserved_zone_enabling; - ld(t0, Address(xthread, JavaThread::reserved_stack_activation_offset())); - bltu(sp, t0, no_reserved_zone_enabling); + ld(t0, Address(xthread, JavaThread::reserved_stack_activation_offset())); + bltu(sp, t0, no_reserved_zone_enabling); - enter(); // RA and FP are live. - mv(c_rarg0, xthread); - rt_call(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone)); - leave(); + enter(); // RA and FP are live. + mv(c_rarg0, xthread); + rt_call(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone)); + leave(); - // We have already removed our own frame. - // throw_delayed_StackOverflowError will think that it's been - // called by our caller. - RuntimeAddress target(StubRoutines::throw_delayed_StackOverflowError_entry()); - relocate(target.rspec(), [&] { - int32_t offset; - movptr(t0, target.target(), offset); - jr(t0, offset); - }); - should_not_reach_here(); + // We have already removed our own frame. + // throw_delayed_StackOverflowError will think that it's been + // called by our caller. + la(t0, RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry())); + jr(t0); + should_not_reach_here(); - bind(no_reserved_zone_enabling); + bind(no_reserved_zone_enabling); } // Move the address of the polling page into dest.