RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v21]

Chen Liang liach at openjdk.org
Tue Jun 18 13:50:17 UTC 2024


On Tue, 18 Jun 2024 13:30:39 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with four additional commits since the last revision:
>> 
>>  - Merge pull request #8 from cl4es/serialization_hostile
>>    
>>    SerializationHostileMethod
>>  - Reduce gratuitous code movement
>>  - Inline Consumer<MethodBuilder> into generateSer.. method, move seldom-used serialization support constants to new holder
>>  - SerializationHostileMethod
>
> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 108:
> 
>> 106: 
>> 107:         // condy to load implMethod from class data
>> 108:         implMethodCondy = DynamicConstantDesc.ofNamed(BSM_CLASS_DATA, DEFAULT_NAME, CD_MethodHandle);
> 
> Pre-existing tiny wart, but this one seem to be used only exceptionally (see the comment/code around line 183) so it's probably better to inline the code at the usage site rather than have a constant.

If we aren't caching this descriptor, maybe it's even more simple for us to just construct the ConstantDynamicEntry from the pool builder at the use site; we can extract a method to keep this condy visible.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17108#discussion_r1644501219


More information about the core-libs-dev mailing list