RFR: 8332900: RISC-V: refactor nativeInst_riscv.cpp and macroAssembler_riscv.cpp [v4]

Robbin Ehn rehn at openjdk.org
Mon Jun 3 10:51:01 UTC 2024


On Mon, 3 Jun 2024 08:16:42 GMT, Hamlin Li <mli at openjdk.org> wrote:

> I'm not sure. If this is a problem in this patch, then in original implementation, MASM.hpp includes nativeInst.hpp, it will cause the similar issue? In another hand, will unused methods in a header file still exist in the compiled binary?

It's about having readable header, havin long private, not part of API, method in header clobber it.
They will not exists, but compiling away methods is not free as it prolongs the compile time.

> 
> The reason I do it this way is because I just want to refactor necessary things (the pricipal is to only nativeInst depends on macroAssembler, not in reverse direction), for other things, I try to keep it as original ones. So if there is other optimization opportunities, it's better to do it in separate pr's.

If this is a simple move of code, then I suggest you wait until my patch, as that changes names and doubles the methods which you want to move.

Also now NativeCall::instruction_size, which is used in shared code is nativeInst, but NativeInstruction::instruction_size is in MASM. From my patch riscv.ad file:


int MachCallDynamicJavaNode::ret_addr_offset()
{
  return NativeMovConstReg::movptr2_instruction_size +  NativeInstruction::instruction_size; // movptr2, jal
  if (UseTrampolines) {
    return NativeMovConstReg::movptr2_instruction_size +  NativeInstruction::instruction_size; // movptr2, jal
  }
}

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19459#issuecomment-2144881602


More information about the hotspot-dev mailing list