RFR: 8362515: RISC-V: cleanup NativeFarCall [v3]

Hamlin Li mli at openjdk.org
Mon Jul 21 08:55:46 UTC 2025


On Mon, 21 Jul 2025 07:52:53 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix
>
> src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 131:
> 
>> 129: }
>> 130: 
>> 131: bool RelocCall::set_destination_mt_safe(address dest, bool assert_lock) {
> 
> Seens you need to merge latest HEAD and rebase. The `assert_lock` param of `NativeFarCall::set_destination_mt_safe` has been removed recently.

Thanks for reminding, it's merged.

> src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 190:
> 
>> 188:   assert(code != nullptr, "Could not find the containing code blob");
>> 189: 
>> 190:   address dest = MacroAssembler::target_addr_for_insn(call_addr);
> 
> Is this change safe? Seems it modifies the original logic.

Yes, `MacroAssembler::pd_call_destination` only call `MacroAssembler::target_addr_for_insn`.
And `MacroAssembler::target_addr_for_insn` are used in other places in NativeFarCall, so it's better to use `target_addr_for_insn` only to improve readability.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26370#discussion_r2218561860
PR Review Comment: https://git.openjdk.org/jdk/pull/26370#discussion_r2218560427


More information about the hotspot-compiler-dev mailing list