On Thu, 27 Aug 2026 08:06:38 GMT, Johan Sjölen <[email protected]> wrote:
>> src/hotspot/share/cds/aotMappedHeapWriter.cpp line 750:
>>
>>> 748: fake_oop->set_mark(fake_oop->mark().copy_set_hash(src_hash));
>>> 749: } else if (Arguments::is_valhalla_enabled()) {
>>> 750:
>>> fake_oop->set_mark(src_klass->prototype_header().copy_set_hash(src_hash));
>>
>> BTW, what is this code all about? Here we know that Valhalla is enabled and
>> that the object is not a value object, so why do we need to use the
>> `prototype_header()` for this? Maybe something to look into outside this PR.
>
> @iklam , I agree with Stefan, this looks wrong. What do you think?
I just rewrote this function to always use the `prototype_header()` (from the
klass with preivew). Now it does not read from the `fake_oop` but regenerates
the whole header from the metadata. This makes it more like the streaming
version.
I guess it might still be worth to verify that what we copied / mapped from the
archive have the same Valhalla property bits as the new header we recreate from
the metadata.
I am up for different suggestions, but I prefer the solution I pushed (similar
to the streaming case) where we unconditionally write the new header.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32535#discussion_r3870097021