RFR: 8275527: Refactor forward pointer access [v4]

Roman Kennke rkennke at openjdk.java.net
Wed Nov 10 12:52:13 UTC 2021

On Mon, 1 Nov 2021 09:25:52 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>>   Move forward impl into markWord and add assert
> src/hotspot/share/oops/markWord.hpp line 253:
>> 251:     return cast_to_oop(decode_pointer());
>> 252:   }
>> 253: };
> This brings the forwarded/forwardee terminology into the markWord. The markWord was previously decoupled from those to concepts. I would personally let those function names stay in oopDesc and not leak down into the markWord. If you do want to keep it here, could you update the comments at the top that describes the bits?
> //    [ptr             | 11]  marked             used to mark an object

Yeah, I am not quite sure about this. We have a couple of places where we need to use the markWord direcly, and they read m.is_marked() (when it really means is_forwarded, even though it's the same in the implementation), and then goes on to cast_to_oop(m.decode_pointer()) which reads more ugly than simply m.forwardee() which also comes with an assert and the cast.

I reverted the markWord change and related call-sites now. Maybe this warrants more thinking/discussion.


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

More information about the hotspot-gc-dev mailing list