RFR: 8343430: RISC-V: C2: Remove old trampoline call [v6]

Hamlin Li mli at openjdk.org
Fri Nov 8 15:10:46 UTC 2024


On Wed, 6 Nov 2024 06:28:07 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hi, please consider this cleanup change.
>> 
>> The old trampoline call on linux-riscv64 is disabled by default after: https://bugs.openjdk.org/browse/JDK-8332689.
>> And the new solution (load target address from stub and call) has been baked in jdk master for quite some time.
>> This propose to remove the old trampoline call related logic so that the code will be cleaner and easier to maintain.
>> As we are still using `trampoline_stub_Relocation` for the stub, I kept using the original `emit_trampoline_stub` name.
>> 
>> Testing on linux-riscv64:
>> - [x] tier1-tier3 (release)
>> - [x] hotspot:tier1 (fastdebug)
>
> Fei Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   More naming

Thanks for updating. Sorry for the delay.
Just had another look, got some questions.

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 4227:

> 4225:     auipc(tmp, (int32_t)distance + 0x800);
> 4226:     ld(tmp, Address(tmp, ((int32_t)distance << 20) >> 20));
> 4227:     jalr(tmp);

Seems we can totally remove the usage of `distance`? could be something like below:

auipc(tmp, 0);
ld(tmp, Address(tmp, 0));
jalr(tmp);

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

PR Review: https://git.openjdk.org/jdk/pull/21822#pullrequestreview-2424042545
PR Review Comment: https://git.openjdk.org/jdk/pull/21822#discussion_r1834547049


More information about the hotspot-dev mailing list