On Mon, 9 Sep 2024 10:21:54 GMT, Thomas Schatzl <tscha...@openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fix bit counts in GCForwarding
>
> src/hotspot/share/gc/shared/collectedHeap.cpp line 232:
> 
>> 230:   }
>> 231: 
>> 232:   // With compact headers, we can't safely access the class, due
> 
> Suggestion:
> 
>   // With compact headers, we can't safely access the klass, due
> 
> 
> This is the case why? Because we might not have copied the header yet? Is 
> this method actually ever used while the forwarded object is unstable?
> Given this is used for verification only afaik, we should make an effort to 
> provide that check.

With compact headers, we can't safely access the Klass* when the object has 
been forwarded, because non-full-GC-forwarding temporarily overwrites the 
mark-word, and thus the Klass*, with the forwarding pointer, and here we have 
no way to make a distinction between Full-GC and regular GC forwarding.

I improved the code to make the check when the object is not forwarded. Not 
sure if we could/should do more (e.g. pass around is_full argument to make the 
distinction, or find the - possibly few - places where we might call is_oop() 
on from-space objects in regular GC and do the check in a forwardee-safe way?).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1751448814

Reply via email to