RFR(S) 8249276 CDS archived objects must have "neutral" markwords
David Holmes
david.holmes at oracle.com
Tue Aug 4 01:13:52 UTC 2020
Hi Ioi,
On 27/07/2020 3:20 pm, Ioi Lam wrote:
> https://bugs.openjdk.java.net/browse/JDK-8249276
> http://cr.openjdk.java.net/~iklam/jdk16/8249276-reset-archive-obj-headers.v01/
>
>
> Please review this change (initial patch provided by David Holmes; I
> rearranged it a little and added more comments).
>
> We reinitialize the markWord of all archived objects to remove any side
> effect of GC/locking/etc during "java -Xshare:dump".
Changes look good to me (naturally :) ). A couple of nits:
int hash_archived = archived_oop->identity_hash();
assert(hash_original == hash_archived, "Different hash codes:
original %x, archived %x", hash_original, hash_archived);
the has_archived setting should be in ifdef DEBUG.
42 Object.class.wait();
43 }
44 System.out.println("Huh?? notified??");
That could be a spurious wakeup. You could just use Thread.sleep with a
suitably long sleep time. that said I'm not sure how the test is
intended to operate. If premain returns after starting the thread there
is no guarantee the thread will start executing and lock the object
before the dump actually commences. Even the sighting of "Let's wait
....." is not sufficient to guarantee that unless you move it inside the
sync block.
> (David mentioned in the bug comments about assertions inside the
> identity_hash() call, but maybe this should be fixed in a different bug?)
Yes those assertions are being removed under:
https://bugs.openjdk.java.net/browse/JDK-8250606
Thanks,
David
-----
> Tested with mach5 tiers 1-4.
>
> Thanks
> - Ioi
More information about the hotspot-runtime-dev
mailing list