RFR: 8305898: Alternative self-forwarding mechanism [v14]

Albert Mingkun Yang ayang at openjdk.org
Mon May 15 13:26:57 UTC 2023


On Sat, 13 May 2023 22:07:41 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> Currently, the Serial, Parallel and G1 GCs store a pointer to self into object headers, when compaction fails, to indicate that the object has been looked at, but failed compaction into to-space. This is problematic for compact object headers ([JDK-8294992](https://bugs.openjdk.org/browse/JDK-8294992)) because it would (temporarily) over-write the crucial class information, which we need for heap parsing. I would like to propose an alternative: use the bit #3 (previously biased-locking bit) to indicate that an object is 'self-forwarded'. That preserves the crucial class information in the upper bits of the header until the full header gets restored.
>
> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix tests on 32bit builds

src/hotspot/share/oops/markWord.hpp line 107:

> 105:   static const int age_bits                       = 4;
> 106:   static const int lock_bits                      = 2;
> 107:   static const int self_forwarded_bits            = 1;

This warrants some update to the doc above, right?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13779#discussion_r1193832971


More information about the hotspot-dev mailing list