RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v9]

Stefan Karlsson stefank at openjdk.org
Mon Sep 9 20:07:13 UTC 2024


On Mon, 9 Sep 2024 18:15:38 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with six additional commits since the last revision:
>> 
>>  - Print as warning when UCOH doesn't match in CDS archive
>>  - Improve initialization of mark-word in CDS ArchiveHeapWriter
>>  - Simplify getKlass() in SA
>>  - Simplify oopDesc::init_mark()
>>  - Get rid of forward_safe_* methods
>>  - GCForwarding touch-ups
>
> src/hotspot/share/oops/typeArrayKlass.cpp line 175:
> 
>> 173: size_t TypeArrayKlass::oop_size(oop obj) const {
>> 174:   // In this assert, we cannot safely access the Klass* with compact headers.
>> 175:   assert(UseCompactObjectHeaders || obj->is_typeArray(),"must be a type array");
> 
> Why not?  I think I'm missing something.  Klass should be in the markWord and that should be ok (?)

I tracked this down to only (at least in my testing) happen from `size_given_klass` when called from the GC when it is about to copy an object. While that happens another thread can racingly succeed to copy the object and install a forwarding pointer over the old copy. When that happens the klass pointer is broken and the call to oopDesc::is_typeArray() crashes.

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

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


More information about the build-dev mailing list