RFR: 8343789: Move mutable nmethod data out of CodeCache [v2]

Boris Ulasevich bulasevich at openjdk.org
Mon Dec 16 16:59:57 UTC 2024


On Fri, 13 Dec 2024 22:06:42 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Thanks for pointing that out. I reworked the method a little.
>> 
>> ldr_patchable() is only called by movoop(). If oops is moved to a separate location, the distance is certainly > 1MB and adrp+ldr is the only way to access oops. The single LDR path is not used now, but I leave it for future use.
>> 
>> 
>>   void ldr_patchable(Register dest, const Address &const_addr, bool fits_in_ldr_range = false) {
>>     if (fits_in_ldr_range) {
>>       intptr_t offset = pc() - const_addr.target();
>>       assert(offset >= -1024 * 1024, offset < 1024 * 1024, "pointer does not fit into pc-relative ldr range")
>>       ldr(dest, const_addr);
>>     } else {
>>       uint64_t offset;
>>       adrp(dest, const_addr, offset);
>>       ldr(dest, Address(dest, offset));
>>     }
>>   }
>
> The problem with leaving "fits_in_ldr_range" in for future use is that it hasn't been tested.  I suggest just removing it.  It uses pc() instead of the codecache boundaries to decide the range, so it only works for code that isn't relocated.

Agree. Thank you!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21276#discussion_r1887179694


More information about the hotspot-compiler-dev mailing list