RFR: 8336492: Regression in lambda serialization [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Jul 29 17:06:33 UTC 2024
On Fri, 26 Jul 2024 21:59:26 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add more docs to CaptureScanner, and make fields private/final
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java line 338:
>
>> 336: @Override
>> 337: public void visitClassDef(JCClassDecl tree) {
>> 338: KlassInfo prevKlassInfo = kInfo;
>
> future improvement? we have class info, lambda context, capture site info, should we probably gather them all in an environment like structure?
yes and no. First, note that capture site info is gone.
As for lambda context and klass info, we use them in different ways: the lambda context is set when we're in a lambda. The klass info is set when we are inside a klass. We create many lambda contexts for each klass info. We could of course move the lambda context field from the visitor to klass info, but I'm not sure how much that buys.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20349#discussion_r1695570111
More information about the compiler-dev
mailing list