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

Robbin Ehn rehn at openjdk.org
Mon Jun 17 08:17:19 UTC 2024


On Thu, 13 Jun 2024 20:34:19 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>> 
>>  - Merge branch 'master' into 8332689
>>  - Merge branch 'master' into 8332689
>>  - Merge branch 'master' into 8332689
>>  - Merge branch 'master' into 8332689
>>  - Remove tmp file
>>  - Prepare for dynamic NativeCall size
>>  - Only allow one calling convetion, i.e. fixed sized
>>  - Merge branch 'master' into 8332689
>>  - Review comments
>>  - Move shart/far code to cpp
>>  - ... and 6 more: https://git.openjdk.org/jdk/compare/5d2a19de...bb7249b8
>
> src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 392:
> 
>> 390:     stub_addr = MacroAssembler::target_addr_for_insn(call_addr);
>> 391:   }
>> 392:   return stub_addr;
> 
> Naming here is confusing, as the returned value is not stub addr, but target addr of a jump.
> Suggestion:
> 
>   if (stub_addr != nullptr) {
>     return MacroAssembler::target_addr_for_insn(call_addr);
>   }
>   return nullptr;

The return value MASM::target_addr_for_insn() is for the load in:
auipc
ld <-------------------
jalr

During relocation the stub is moved as is, meaning it contains the correct destination.
So all we need to do is to make for the auipc + ld is loading from the stub.

Thus this code is only concerned about where the stub address is.

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

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


More information about the hotspot-dev mailing list