Integrated: 8275527: Refactor forward pointer access

Roman Kennke rkennke at
Thu Nov 18 21:35:51 UTC 2021

On Thu, 14 Oct 2021 16:37:02 GMT, Roman Kennke <rkennke at> wrote:

> Accessing the forward pointer is currently a little inconsistent. Some code paths call oopDesc::forwardee() / oopDesc::is_forwarded(), some code paths call forwardee() and check it for ==/!= NULL, some code paths even call markWord::decode_pointer() and markWord::is_marked() instead.
> This change attempts to make the situation more consistent. For simple cases it preserves oopDesc::forwardee() / is_forwarded(), some cases need to use the markWord for consistency in concurrent GC, they now use markWord::forwardee() and markWord::is_forwarded(). Also, checking whether or not an object is forwarded is now consistently done using is_forwarded() and not by checking forwardee ==/!= NULL. This also resolves the mess in G1 full GC that changes not-forwarded objects to have a NULL (fake-) pointer. This is not necessary, because we can just as well use the lock bits to determine whether or not the object is forwarded.
> Testing:
>  - [x] tier
>  - [x] tier2
>  - [x] hotspot_gc

This pull request has now been integrated.

Changeset: 89b125f4
Author:    Roman Kennke <rkennke at>
Stats:     46 lines in 9 files changed: 4 ins; 26 del; 16 mod

8275527: Refactor forward pointer access

Reviewed-by: tschatzl, stefank



More information about the hotspot-gc-dev mailing list