On Wed, 21 Aug 2024 20:31:09 GMT, Dean Long <dl...@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.
>
> src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java 
> line 279:
> 
>> 277:         clb.withMethod(invokerName, invokerDesc, ACC_STATIC, config);
>> 278:     }
>> 279: 
> 
> There's probably not much value in using ACC_FINAL here anyway.  We are only 
> using these classes to create static methods, right?  I think ACC_INTERFACE 
> would work here too.

Note that JVMS 4.1 requires `ACC_ABSTRACT` to be also set when `ACC_INTERFACE` 
is set. Also note that some classes capture class data to refer to hidden 
classes and method handles or lambda forms, so those fields' generation need to 
add `ACC_PUBLIC` flag to be usable in interfaces.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19157#discussion_r1725751901

Reply via email to