Skip to content

Commit

Permalink
Backport 8285303: riscv: Incorrect register mask in call_native_base
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeihan committed Apr 1, 2024
1 parent c7d3a44 commit 2dd5675
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
14 changes: 2 additions & 12 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,24 +585,14 @@ void MacroAssembler::emit_static_call_stub() {
void MacroAssembler::call_VM_leaf_base(address entry_point,
int number_of_arguments,
Label *retaddr) {
call_native_base(entry_point, retaddr);
}

void MacroAssembler::call_native(address entry_point, Register arg_0) {
pass_arg0(this, arg_0);
call_native_base(entry_point);
}

void MacroAssembler::call_native_base(address entry_point, Label *retaddr) {
Label E, L;
int32_t offset = 0;
push_reg(0x80000040, sp); // push << t0 & xmethod >> to sp
push_reg(RegSet::of(t0, xmethod), sp); // push << t0 & xmethod >> to sp
movptr_with_offset(t0, entry_point, offset);
jalr(x1, t0, offset);
if (retaddr != NULL) {
bind(*retaddr);
}
pop_reg(0x80000040, sp); // pop << t0 & xmethod >> from sp
pop_reg(RegSet::of(t0, xmethod), sp); // pop << t0 & xmethod >> from sp
}

void MacroAssembler::call_VM_leaf(address entry_point, int number_of_arguments) {
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,6 @@ class MacroAssembler: public Assembler {
// thread in the default location (xthread)
void reset_last_Java_frame(bool clear_fp);

void call_native(address entry_point,
Register arg_0);
void call_native_base(
address entry_point, // the entry point
Label* retaddr = NULL
);

virtual void call_VM_leaf_base(
address entry_point, // the entry point
int number_of_arguments, // the number of arguments to pop after the call
Expand Down

0 comments on commit 2dd5675

Please sign in to comment.