RFR: 8361449: RISC-V: Code cleanup for native call [v2]
Dingli Zhang
dzhang at openjdk.org
Mon Jul 14 04:49:40 UTC 2025
On Sat, 12 Jul 2025 08:04:55 GMT, Feilong Jiang <fjiang at openjdk.org> wrote:
>> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove outdated comments
>
> src/hotspot/cpu/riscv/nativeInst_riscv.cpp line 104:
>
>> 102:
>> 103: CodeBlob *code = CodeCache::find_blob(call_addr);
>> 104: assert(code != nullptr && code->is_nmethod(), "nmethod expected");
>
> The `if (code != nullptr && code->is_nmethod())` statement indicates that `code->is_nmethod()` may not always be true. Do you think we should use assert here? Looks like the new assert logic is inconsistent with the original code.
Following up on 6 [here](https://github.com/openjdk/jdk/pull/19796#issuecomment-2188094970), we also added a fast path in `Relocation::pd_call_destination` , which for ARM64 has the same assertion in `destination()`:
https://github.com/openjdk/jdk/blob/73e3e0edeb20c6f701b213423476f92fb05dd262/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp#L53-L64
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26150#discussion_r2203839770
More information about the hotspot-compiler-dev
mailing list