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

Boris Ulasevich bulasevich at openjdk.org
Mon Mar 10 02:30:08 UTC 2025


On Fri, 21 Feb 2025 01:39:37 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Boris Ulasevich has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 12 commits:
>> 
>>  - Address review comments: cleanup, move fields to avoid padding, fix CodeBlob purge to call os::free, fix nmethod::print, update Layout description
>>  - add a separate adrp_movk function to to support targets located more than 4GB away
>>  - 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
>>  - Fixing TestFindInstMemRecursion test fail with XX:+StressReflectiveCode option:
>>    _relocation_size can exceed 64Kb, in this case _metadata_offset do not fit into int16.
>>    Fix: use _oops_size int16 field to calculate metadata offset
>>  - removing dead code
>>  - a bit of cleanup and addressing review suggestions
>>  - rework movoop for not_supports_instruction_patching case: correcting in ldr_constant and relocations fixup
>>  - remove _code_end_offset
>>  - update jvm.hotspot.code.CodeBlob class
>>  - update: mutable data for all CodeBlobs with relocations
>>  - ... and 2 more: https://git.openjdk.org/jdk/compare/e1d0a9c8...6c3370be
>
> Wouldn't most adrp+movk instructions for oops being computing the same or nearby base addresses?  We could set up a dedicated base pointer to the external oop table at the beginning of the code, then use ldr $oop_table + offset for each oop reference.  Or instead of a reserving a dedicated register that can't be used for anything else, we could allocate a regular spillable register, at the cost of worse performance if it needed to be spilled.

Hi @dean-long,

Would you mind doing a re-review of this PR? I have reverted the movement of oops into a separate buffer, as it caused issues on AArch. All platform-specific details are now removed, making the change much simpler.

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

PR Comment: https://git.openjdk.org/jdk/pull/21276#issuecomment-2709275653


More information about the hotspot-compiler-dev mailing list