RFR: 8316694: Implement relocation of nmethod within CodeCache [v13]

Chad Rakoczy duke at openjdk.org
Fri Apr 25 22:21:51 UTC 2025


On Thu, 24 Apr 2025 23:49:36 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Chad Rakoczy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix branch range check
>
> 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

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2060956552


More information about the hotspot-compiler-dev mailing list