RFR: 8365823: Revert storing abstract and interface Klasses to non-class metaspace [v3]
Coleen Phillimore
coleenp at openjdk.org
Mon Sep 15 15:59:39 UTC 2025
On Mon, 15 Sep 2025 15:06:04 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove CFP.is_abstract().
>
> src/hotspot/share/ci/ciKlass.hpp line 112:
>
>> 110: assert(is_in_encoding_range, "sanity");
>> 111: return is_in_encoding_range;
>> 112: }
>
> I thought about this method, and it _looks_ to be just:
>
>
> bool is_in_encoding_range() {
> assert(CompressedKlassPointers::is_encodable(get_Klass()), "sanity");
> return true;
> }
>
>
> But I think your version is better, since it is more paranoid and actually checks if we are dealing with the class within the class range.
I was on the verge of removing this but that snowballed into removing all sorts of other things that maybe can be removed later. This was sort of where I cut it off and I did like the variable name.
> src/hotspot/share/memory/allocation.cpp line 76:
>
>> 74: // Klass has its own operator new
>> 75: assert(type != ClassType, "class has its own operator new");
>> 76: return Metaspace::allocate(loader_data, word_size, type, /*use_class_space*/ false, THREAD);
>
> Question: now that `ArrayKlass` and `InstanceKlass` do not have `::new`, the assert above is still valid? I am guessing all these inherit `Klass::new`?
Yes, all Klass allocation should call Klass::operator new(). Klass is derived from Metadata that's derived from MetaspaceObj. The Klass operator new _hides_ the one in MetaspaceObj.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27295#discussion_r2349433048
PR Review Comment: https://git.openjdk.org/jdk/pull/27295#discussion_r2349449119
More information about the graal-dev
mailing list