RFR: 8363986: Heap region in CDS archive is not at deterministic address [v2]
Ioi Lam
iklam at openjdk.org
Tue Nov 18 20:15:59 UTC 2025
On Tue, 18 Nov 2025 19:21:45 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>>
>> - clean up of old C++ class name ArchiveHeapWriter
>> - @ashu-mehra comment -- simplified the criteria for _is_writing_deterministic_heap
>> - Merge branch 'master' into 8363986-heap-region-in-aot-cache-not-determinitic-address
>> - More clean up
>> - fixed aot map
>> - clean up
>> - 8363986: Heap region in CDS archive is not at deterministic address
>
> src/hotspot/share/cds/aotMappedHeapWriter.cpp line 109:
>
>> 107: // optimizations such as AOT compiled code require the same compressed oop
>> 108: // encoding to be used in the assembly phase and production run, so we cannot
>> 109: // force (zero-based, no shift) encoding.
>
> In Leyden we do force encoding `(base, shift)` with `-XX:+UseCompatibleCompressedOops` flag in Leyden when AOT code is generated and used:
> https://github.com/openjdk/leyden/blob/premain/src/hotspot/share/oops/compressedOops.cpp#L51
>
> The flag is enabled by default when AOT code is used:
> https://github.com/openjdk/leyden/blob/premain/src/hotspot/share/cds/cdsConfig.cpp#L121
>
> It allows to use different heap size in production runs.
I have updated the comments to avoid discussing future AOT optimizations. Instead, it says:
// Determninistic output is not supported by the new AOT workflow, so
// we don't force the (zero-based, no shift) encoding. This way, it is more
// likely that we can avoid oop relocation in the production run.
> src/hotspot/share/cds/aotMappedHeapWriter.cpp line 588:
>
>> 586: // In the production run, if different COOPS encodings are used:
>> 587: // - The heap contents needs to be relocated.
>> 588: // - AOTCodeCache will be disabled.
>
> Not true by default. See my first comment.
I have deleted the comment about AOTCodeCache.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28052#discussion_r2539579548
PR Review Comment: https://git.openjdk.org/jdk/pull/28052#discussion_r2539581224
More information about the hotspot-runtime-dev
mailing list