RFR: 8362515: RISC-V: cleanup NativeFarCall [v4]
Fei Yang
fyang at openjdk.org
Fri Jul 25 03:37:02 UTC 2025
On Thu, 24 Jul 2025 11:25:37 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> Hi,
>> Can you help to review this patch?
>>
>> By https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp#L1270, there are far call, indirect call, reloc call.
>> NativeFarCall is in fact a reloc call, the name is confusing, better to rename it to RelocCall.
>> Also add some comments and do some other simple cleanup.
>>
>> Thanks!
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>
> remove NativeFarCall/RelocCall
It's great to see that NativeFarCall class is factored out. Thanks for the update!
Overall looks good. Would you mind two minor tweaks about code comment?
src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 51:
> 49: // NativeCall
> 50: //
> 51: // Implements direct far calling loading an address from the stub section version of reloc call.
Suggestion: `// Implements indirect far call loading an address from the stub section of reloc call.`
And I think this comment should be moved to immediately before definition of `MacroAssembler::reloc_call` [1].
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L4982
src/hotspot/cpu/riscv/nativeInst_riscv.hpp line 114:
> 112: // call instructions (used to manipulate inline caches, primitive &
> 113: // DSO calls, etc.).
> 114: // On riscv, NativeCall is a reloc call.
Suggestion: `NativeCall is reloc call on RISC-V. See MacroAssembler::reloc_call`
-------------
PR Review: https://git.openjdk.org/jdk/pull/26370#pullrequestreview-3053949128
PR Review Comment: https://git.openjdk.org/jdk/pull/26370#discussion_r2230047481
PR Review Comment: https://git.openjdk.org/jdk/pull/26370#discussion_r2230035010
More information about the hotspot-compiler-dev
mailing list