[code-reflection] RFR: Simplify code generation for quotable lambdas not to require duplicate capture argument lists
Paul Sandoz
psandoz at openjdk.org
Fri Oct 4 22:28:54 UTC 2024
On Fri, 4 Oct 2024 22:22:43 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> That said - not sure. Isn't `funcOp` the function for the lambda? That should not feature any captured argument - just the parameter of the lambda as they appear in the source. I'm not sure we can deduce the need for `this` capture just by looking at that?
>
> I think my comment was confusing. Here's another way of describing it - you could add the following to `quotedCapturedArgs`
>
> assert bodyScanner.top.body.entryBlock().parameters().size() == bodyScanner.top.localToOp.keySet().size();
>
> The top body becomes the body of the `quotedLambda` func op.
So i think we could avoid `top.localToOp.put(currentClassSym, null)` and detect if we need to synthesize `this` by checking the sizes.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/249#discussion_r1788386644
More information about the babylon-dev
mailing list