On Fri, 6 Sep 2024 16:20:52 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> This change stores InstanceKlass for interface and abstract classes in the 
>> non-class metaspace, since class metaspace will have limits on number of 
>> classes that can be represented when Lilliput changes go in.  Classes that 
>> have no instances created for them don't require compressed class pointers.  
>> The generated LambdaForm classes are also AllStatic, and changing them to 
>> abstract moves them to non-class metaspace too.  It's not technically great 
>> to make them abstract and not final but you can't have both.  Java classfile 
>> access flags have no way of specifying something like AllStatic.
>> 
>> Tested with tier1-8.
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Replace Metaspace::is_compressed_klass_ptr with 
> CompressedKlassPointers::is_in_encoding_range.

Sometimes, if you are very clever and determined, you can do the very 
non-simple thing of putting some items at the least level of indirection, and 
other items at further levels of indirection.  You'd try to put stuff you need 
frequently closer to the root address.

Currently everything is equally close to the root address, except that IIRC we 
try to put a few really performance sensitive things on the earliest cache 
lines.

Splitting one Klass structure into a near and a far part is doable in 
principle, but the complexity adds up quickly, and there is also a problem 
deciding what to put in the near part.

Specifically, you probably want some v-table entries, but not all v-table 
entries, in the near part.  (Why not all?  Because near space is relatively 
scarce.  The near part might even be fixed in size, depending on design.)

The bottom line for me:  I like flatter data and shorter indirection chains.  
The main exception is that I ALSO like to separate hot from cold data, when the 
opportunity arises, and cold data is often at the end of an unused indirection.

(I think there is relatively little cold data in metaspace, and it is probably 
already packed inside a pointer to an Array.)

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

PR Comment: https://git.openjdk.org/jdk/pull/19157#issuecomment-2402774234

Reply via email to