RFR: 8365823: Revert storing abstract and interface Klasses to non-class metaspace

Aleksey Shipilev shade at openjdk.org
Mon Sep 15 13:46:34 UTC 2025


On Mon, 15 Sep 2025 13:28:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change removes the optimization to not store abstract and interface Klass metadata to non-class metaspace.  Now all Klass metadata is in the Klass metaspace.  This is simpler and less bug prone, and didn't help with the limitation of classes that can be stored in class metaspace materially.
> Tested with tier1-4.

First pass comments below.

Also, I looked at original change, and I wonder if we want to revert other changes as well. It looks to me they are fairly innocuous, TBH, so I have no strong opinion about them.

Changing `final` -> `abstract` in `InvokerBytecodeGenerator`: 

https://github.com/openjdk/jdk/commit/ad104932e6c26806c353ad048ce5cff7d2b4c29a?diff=unified#diff-3b05b61400e7766115409b3f508d839fb51e450423822252ab2e18543427c764L249-R249

JFR:

https://github.com/openjdk/jdk/commit/ad104932e6c26806c353ad048ce5cff7d2b4c29a?diff=unified#diff-d58d6d9783cb29084a15c42ecd7f59860a48be8bcfd9be0ee15a9d50209b576fR1-R160

And to the test:

https://github.com/openjdk/jdk/commit/ad104932e6c26806c353ad048ce5cff7d2b4c29a?diff=unified#diff-00138acd973f46c5f91674e5388ee82d2e7ed1b788ed551f34120cc761d228b7L1-R166

src/hotspot/share/memory/metaspace.cpp line 885:

> 883:   MetaspaceCriticalAllocation::block_if_concurrent_purge();
> 884: 
> 885:   MetadataType mdtype = type == MetaspaceObj::ClassType ? ClassType: NonClassType;

This matches the style of original hunk:

Suggestion:

  MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;


(see https://github.com/openjdk/jdk/commit/ad104932e6c26806c353ad048ce5cff7d2b4c29a?diff=unified#diff-d22e3e58e52d574f4277c0f89304d775b68833148a57c5af6760395b002b2b86L843-R843)

src/hotspot/share/memory/metaspace.cpp line 920:

> 918: 
> 919:   if (result == nullptr) {
> 920:     MetadataType mdtype = type == MetaspaceObj::ClassType ? ClassType: NonClassType;

Suggestion:

    MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;

src/hotspot/share/oops/klass.cpp line 281:

> 279: #ifdef _LP64
> 280:   if (UseCompactObjectHeaders) {
> 281:     precond(CompressedKlassPointers::is_encodable(kls));

Sounds like we want to leave this comment in:


// With compact object headers, the narrow Klass ID is part of the mark word.
// We therefore seed the mark word with the narrow Klass ID.

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

PR Review: https://git.openjdk.org/jdk/pull/27295#pullrequestreview-3224650389
PR Review Comment: https://git.openjdk.org/jdk/pull/27295#discussion_r2349034149
PR Review Comment: https://git.openjdk.org/jdk/pull/27295#discussion_r2349035742
PR Review Comment: https://git.openjdk.org/jdk/pull/27295#discussion_r2349020024


More information about the graal-dev mailing list