RFR: 8332689: RISC-V: Use load instead of trampolines [v14]

Fei Yang fyang at openjdk.org
Tue Jun 25 07:58:18 UTC 2024


On Mon, 24 Jun 2024 15:15:02 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/riscv.ad line 1244:
>> 
>>> 1242:     return 1 * NativeInstruction::instruction_size; // jal
>>> 1243:   }
>>> 1244:   return 3 * NativeInstruction::instruction_size; // auipc + ld + jalr
>> 
>> Question: As we will only patch the address in the stub, do we still need the handling in compute_padding (`CallStaticJavaDirectNode::compute_padding` & `CallDynamicJavaDirectNode::compute_padding`) when `UseTrampolines` is false?
>
> No, not that I know of. But we need additional fixes, some asserts needs to tweaked and PostCallNop expects aligned calls (as we want to patch nop -> trap not crossing pages) so we instead need padding after.
> 
> I think we can either have:
> `c.nop, auipc, ld, jalr, nop (cmodx to trap), nop`
> `auipc, ld, jalr, c.nop, nop (cmodx to trap), nop`
> 
> It seems to me keeping what we have is just simplest.
> 
> What you reckon?

Ah, I didn't notice the PostCallNop at the end. I agree it will be safer to keep the current shape.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19453#discussion_r1652184652


More information about the hotspot-dev mailing list