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

Roman Kennke rkennke at openjdk.org
Thu Feb 8 14:37:20 UTC 2024


> Currently, the Serial, Parallel and G1 GCs store a pointer to self into object headers to indicate promotion failure. 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 currently unused 3rd header bit (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.
> 
> This is a trimmed-down/simplified version of the original proposal #13779:
>  - It doesn't use/introduce any flags and avoids the associated branching.
>  - It doesn't (need to) deal with displaced headers. (Current code would preserve header if necessary, Lilliput code would not use displaced headers and set the 3rd bit directly in existing header.)
> 
> Testing:
>  - [x] hotspot_gc
>  - [x] tier1
>  - [x] tier2

Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:

  More consistent use of markWord::is_forwarded()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17755/files
  - new: https://git.openjdk.org/jdk/pull/17755/files/fbfb1e73..f844954f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17755&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17755&range=02-03

  Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/17755.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17755/head:pull/17755

PR: https://git.openjdk.org/jdk/pull/17755


More information about the hotspot-gc-dev mailing list