[master] RFR: Store (narrow) klass in object header

Roman Kennke rkennke at openjdk.java.net
Fri May 21 18:23:19 UTC 2021


On Fri, 21 May 2021 18:16:43 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> src/hotspot/share/cds/archiveBuilder.cpp line 785:
>> 
>>> 783: #ifdef _LP64
>>> 784:   o->set_mark(o->mark().set_narrow_klass(nk));
>>> 785: #endif
>> 
>> So... is `o->set_narrow_klass(nk)` the line below doing the same? Also, why only `_LP64`?
>
> No, o->set_narrow_klass(nk) sets the field in the Klass* slot, while the other sets the field in the header slot. The Klass* slot will eventually go away - but not now.

Oh and only _LP64 because in 32 bit builds we don't have 'upper 32 bits' in header. OTOH, I guess archive dumping is 64bit only...

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

PR: https://git.openjdk.java.net/lilliput/pull/7


More information about the lilliput-dev mailing list