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

Andrew Dinn adinn at openjdk.org
Mon Feb 3 14:19:51 UTC 2025


On Mon, 3 Feb 2025 11:42:14 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Force the use of movk in combination with adrp and ldr instructions to address scenarios
>>   where os::malloc allocates buffers beyond the typical ±4GB range accessible with adrp
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1422:
> 
>> 1420:     bool force_movk = true; // movk is important if the target can be more than 4GB away
>> 1421:     adrp(dest, const_addr, offset, force_movk);
>> 1422:     ldr(dest, Address(dest, offset));
> 
> I wonder if this really is the best way to do it. It's not clear to me that there is any advantage of using `adrp` in this case rather than a simple `mov(scratch, const_adr); ldr(dest, Address(scratch);`. The `mov` would produce `movz; movk; movk` which almost certainly execute in a single cycle, then a load without an offset, which is a single micro-op rather than two micro-ops for load+offset. All we've gained for this complication is a small reduction in code density rather than a performance improvement. I'd go with simplicity.

Yes, I agree.

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

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


More information about the hotspot-compiler-dev mailing list