8285303: riscv: Incorrect register mask in call_native_base

Co-authored-by: Dingli Zhang <dingli@iscas.ac.cn>
Reviewed-by: fyang, yadongwang
This commit is contained in:
Feilong Jiang 2022-04-22 23:48:57 +00:00 committed by Fei Yang
parent ce8db2c403
commit b10833bbf3
2 changed files with 2 additions and 19 deletions

View File

@ -569,24 +569,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) {

View File

@ -147,13 +147,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