Skip to content

Commit

Permalink
JDK-8337788: RISC-V: Cleanup code in MacroAssembler::reserved_stack_c…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
zifeihan committed Aug 4, 2024
1 parent 367e0a6 commit d08100f
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d08100f

Please sign in to comment.