RFR: 8330585: Refactor/rename forwardee handling

Stefan Karlsson stefank at openjdk.org
Fri Apr 19 13:27:57 UTC 2024


On Fri, 19 Apr 2024 12:25:58 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> In several places in GCs we use is_marked() where we really mean is_forwarded(), and do weird things like decode forwardee directly from a markWord instead of using a proper helper, etc.
> 
> This change cleans it up. It introduces a bunch of APIs to facilitate that: 
>  - oopDesc::forwardee(markWord): This doesn't have to be in oopDesc right now, but I'd like to put it there in preparation of https://bugs.openjdk.org/browse/JDK-8305898, which requires it to be in oopDesc. Also, it's nice as a non-racy companion of oopDesc::forwardee().
>  - oopDesc::is_forwarded(markWord): It doesn't have to be in oopDesc, either, but I think it's good to have it at the same level of API abstraction as oopDesc::forwardee(markWord).
> 
> Testing:
>  - [x] hotspot_gc
>  - [x] tier1

I agree that we should update the code to use `is_forwarded` and `forwardee`. It makes the code nicer to read.

I would like to defer adding the oopDesc member functions in this patch, and bring that in when we integrate the lilliput/self-forwarding changes.

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

Changes requested by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18863#pullrequestreview-2011425934


More information about the hotspot-gc-dev mailing list