RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v18]
Claes Redestad
redestad at openjdk.org
Tue Jun 18 10:14:18 UTC 2024
On Mon, 17 Jun 2024 11:21:37 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> 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.
I'll note that replacing a lambda with an anonymous class has a very marginal effect on startup when amortizing the cost of setting up the infrastructure for spinning classes. What can have a decent effect is if we can replace a few lambdas/anon classes with more imperative code that spins up/loads fewer classes, e.g., desugaring streams to for loops.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17108#discussion_r1644202229
More information about the core-libs-dev
mailing list