Fix bitset of push_reg/pop_reg in MacroAssembler::call_native_base

Dingli Zhang dingli at iscas.ac.cn
Thu Apr 21 01:07:42 UTC 2022


Hi, I found a small problem in src/hotspot/cpu/riscv/macroAssembler_riscv.cpp:

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
  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
}

Bitset of '0x80000040' operates << t1 & xmethod >> here, I think it should be '0x80000020' for << t0 & xmethod >>.

I pushed a small patch here: https://github.com/DingliZhang/jdk/commit/6a52ec04b0582b8f4219d6a3e9b7ab64e7a97de3

Best regards,
Dingli


More information about the riscv-port-dev mailing list