-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
b21
The ClassData of a LambdaForm class is always passed as an ArrayList, even if the list contains a single element
https://github.com/openjdk/jdk/blob/21407dec0156301871a83328615e4d975c4287c4/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java#L382-L394
We should optimize for the single-element case for a small code size and speed improvement.
Data with the exploded JDK:
$ java -cp . HelloWorld
total generated LambdaForms: 34
with a single ClassData: 34
$ java -jar $ECLIPSE
total generated LambdaForms: 427
with a single ClassData: 406
(There are no LambdaForms with 0 ClassData in either case, so that's not worth optimizing).
https://github.com/openjdk/jdk/blob/21407dec0156301871a83328615e4d975c4287c4/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java#L382-L394
We should optimize for the single-element case for a small code size and speed improvement.
Data with the exploded JDK:
$ java -cp . HelloWorld
total generated LambdaForms: 34
with a single ClassData: 34
$ java -jar $ECLIPSE
total generated LambdaForms: 427
with a single ClassData: 406
(There are no LambdaForms with 0 ClassData in either case, so that's not worth optimizing).