RFR: 8305895: Implementation: JEP 450: Compact Object Headers (Experimental) [v13]

Roman Kennke rkennke at openjdk.org
Fri May 12 16:49:56 UTC 2023


On Fri, 12 May 2023 15:29:28 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Some hashcode improvements (mostly SA)
>
> src/hotspot/share/gc/parallel/psPromotionManager.cpp line 293:
> 
>> 291: 
>> 292:   oop old = task.to_source_array();
>> 293:   assert(old->forward_safe_klass()->is_objArray_klass(), "invariant");
> 
> Why sometimes forward_safe_klass()?  Shouldn't all calls to klass() be "forward_safe"?  How do you know where to put this version of the klass() call?

There are situations in GC where the object can be forwarded or not. This is where those methods are useful and required for compact-headers, because the mark-word and therefore Klass* could only be loaded from the forwardee. Originally I put this code in places where it happened in each GC, but eventually realized that it is a somewhat common pattern, so I put it in oopDesc. But we need to be careful there, because we have two different ways to deal with forwarding full-GC uses sliding-forwarding (which preserves the Klass* in the mark-word) and normal-GCs use the normal-forwarding which only preserves the Klass* in the forwardee. The forward_safe_* methods only work on the latter, and are only required in the latter. But that is not very difficult to sort out, IMO, because full-GCs are in fully separate code paths anyway.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13844#discussion_r1192598914


More information about the shenandoah-dev mailing list