RFR: 8316694: Implement relocation of nmethod within CodeCache [v32]
Chad Rakoczy
duke at openjdk.org
Wed Jul 2 22:24:09 UTC 2025
On Tue, 1 Jul 2025 08:37:32 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> Chad Rakoczy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 90 commits:
>>
>> - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>> - Update how call sites are fixed
>> - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>> - Fix pointer printing
>> - Use set_destination_mt_safe
>> - Print address as pointer
>> - Use new _metadata_size instead of _jvmci_data_size
>> - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>> - Only check branch distance for aarch64 and riscv
>> - Move far branch fix to fix_relocation_after_move
>> - ... and 80 more: https://git.openjdk.org/jdk/compare/f799cf18...70e4164e
>
> src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp line 84:
>
>> 82: if (NativeCall::is_call_at(addr())) {
>> 83: NativeCall* call = nativeCall_at(addr());
>> 84: if (be_safe) {
>
> Why is this change necessary?
The original motivation was to address far call sites. After relocation, some calls that previously didn't require a trampoline might now need one, hence the introduction of the `be_safe` parameter. However, upon further review, this change is unnecessary. The method `trampoline_stub_Relocation::fix_relocation_after_move` already updates the owner and contains the logic to determine whether a direct call can be performed. Therefore, we can skip invoking `CallRelocation::fix_relocation_after_move` for calls that use trampolines, as all required adjustments will be handled correctly by the trampoline relocations. ([Reference](https://github.com/chadrako/jdk/blob/0f4ff9646d1f7f43214c5ccd4bbe572fffd08d16/src/hotspot/share/code/nmethod.cpp#L1547-L1556))
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2181076900
More information about the hotspot-compiler-dev
mailing list