RFR: 8354887: Preserve runtime blobs in AOT code cache [v2]
Ashutosh Mehra
asmehra at openjdk.org
Wed May 7 21:52:59 UTC 2025
On Wed, 7 May 2025 19:35:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Ashutosh Mehra has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
>>
>> - Merge branch 'master' into preserve-runtime-blobs-master
>> - Address Vladimir's comments
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Remove irrelevant comment
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Fix win64 compile failures
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Fix AOTCodeFlags.java test
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Fix compile failure in minimal config
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Revert back changes that added AOTRuntimeConstants.
>> Ensure CompressedOops::base and CompressedKlssPointers::base does not
>> change in production run
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Fix merge conflicts
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Store/load AsmRemarks and DbgStrings in aot code cache
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - Add missing external address in aarch64
>>
>> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>> - ... and 1 more: https://git.openjdk.org/jdk/compare/2a4f37cc...ba612dab
>
> I think it is fine not use AOT code when the heap base does not match. Based on my test it will happen only with big heap's size difference between assembly and production runs.
@vnkozlov I wonder if that assert needs modification as well.
This assert assumes that if `CompressedOops::_base` is not null, then it will be set to a page size before the heap range start. This is fine because _base is not null only when heap range goes beyond `OopEncodingHeapMax`, and in such cases `ReservedHeapSpace::noaccess_prefix` is equal to `os::vm_page_size()`.
But with `UseCompatibleCompressedOops` the _base is set to non-null value even when heap range is within `OopEncodingHeapMax` and in such cases `ReservedHeapSpace::noaccess_prefix` is 0.
I think the assert should be using `noaccess_prefix` instead of hard-coding `os::vm_page_size`:
- assert((intptr_t)base() <= ((intptr_t)_heap_address_range.start() - (intptr_t)os::vm_page_size()) ||
+ assert((intptr_t)base() <= ((intptr_t)_heap_address_range.start() - (intptr_t)heap_space.noaccess_prefix()) ||
With this change I can run the helloworld program with `UseCompatibleCompressedOops` enabled.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25019#issuecomment-2860472892
More information about the hotspot-runtime-dev
mailing list