RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v18]
Adam Sotona
asotona at openjdk.org
Mon Jun 17 11:24:31 UTC 2024
On Thu, 13 Jun 2024 09:27:44 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java line 616:
>>
>>> 614: final ClassDesc classDesc = ClassDesc.of(className0);
>>> 615: final ClassDesc superClassDesc = classDesc(speciesData.deriveSuperClass());
>>> 616: return ClassFile.of().build(classDesc, clb -> {
>>
>> We need a confirmation here that these BMH species are only initialized after LMF is ready. @cl4es Is a dependency on LMF from BMH safe?
>
> LMF will BMH and `ClassSpecializer`, but does not call into this code normally as the simple bound method handle needed by LMF is statically defined (`BoundMethodHandle.Species_L`). To be perfectly safe - and to keep lambda/indy/condy bootstrap overheads to a minumum - I'll continue recommending the desugaring of lambdas in java.lang.invoke
It results in not very nice code, but makes sense.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17108#discussion_r1642653369
More information about the core-libs-dev
mailing list