RFR: 8316694: Implement relocation of nmethod within CodeCache [v13]
Chad Rakoczy
duke at openjdk.org
Fri Apr 25 22:52:53 UTC 2025
On Fri, 25 Apr 2025 22:18:08 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/assembler_aarch64.hpp line 940:
>>
>>> 938:
>>> 939: static bool reachable_from_branch_at(address branch, address target, bool use_max=false) {
>>> 940: return uabs(target - branch) < (use_max ? max_branch_range : branch_range);
>>
>> This might be the wrong approach. Using the max range will make the assert below fail less often in debug builds, but disables the stress feature of using the shorter 2M range.
>
> ~I did this because during code buffer expansion `pd_set_call_destination` gets called but there is no relocation info at that time. So with debug builds it was incorrectly trying to find a trampoline stub that did not exist yet because it believed it needed to when it didn't. I agree this is probably not the best approach though and I will look for a better solution~
Actually the issue is not during code buffer expansion. It's called when creating a new nmethod that I can only get to occur when using the Graal compiler. So it may not be true that calls always have trampolines in the case of Graal. This _fix_ may just make the bug harder to encounter
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2060974982
More information about the hotspot-compiler-dev
mailing list