Integrated: 8275527: Refactor forward pointer access

Roman Kennke rkennke at openjdk.java.net
Thu Nov 18 21:35:51 UTC 2021


On Thu, 14 Oct 2021 16:37:02 GMT, Roman Kennke <rkennke at openjdk.org> 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 openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/89b125f4d4d6a467185b4b39861fd530a738e67f
Stats:     46 lines in 9 files changed: 4 ins; 26 del; 16 mod

8275527: Refactor forward pointer access

Reviewed-by: tschatzl, stefank

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

PR: https://git.openjdk.java.net/jdk/pull/5955


More information about the shenandoah-dev mailing list