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

Roman Kennke rkennke at openjdk.org
Fri May 12 16:59:53 UTC 2023


On Fri, 12 May 2023 16:03:26 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/oops/oop.inline.hpp line 126:
> 
>> 124: 
>> 125: Klass* oopDesc::klass_or_null() const {
>> 126: #ifdef _LP64
> 
> I don't like all these #ifdef _LP64 here.  Maybe markWord.inline.hpp can be refactored to not require callers to have this conditional inclusion.

The problem is with 32bits, in markWord, we only have 32bits in the header, and no place to stick in the Klass* in the upper 32 bits. That's why I put all those #ifdefs, there.
If you take a step back, you'll notice that compact object headers mostly aligns the layout headers of 64bit and 32bit JVMs. There would be a great opportunity here to consolidate all this code, make the whole header a union/struct/bitfield that looks the same both on 32bit and 64bit builds. But this conflicts with the current implementation where we want to be able to switch between compact and legacy header layout.

Also, going forward, we want to shrink the header even more to just 32bits, and still have it switchable with the old layout. Eventually all this stuff will be the same in 32bit and 64bit JVMs, but for the time being I think we need to keep it slightly messy to support the legacy layout.

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

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


More information about the hotspot-dev mailing list