[code-reflection] RFR: Replace the use of Interpreter to create Quoted instance with specialized code [v4]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed May 28 17:15:03 UTC 2025
On Wed, 28 May 2025 16:10:22 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>>> > The main goal is to replace the use of the interpreter, but we really need to specify what is going on
>>>
>>> Right -- that was my feeling. Then I suppose @mabbay found that the model produced by javac for quoted lambdas does not respect the specification we set forth. Doesn't that defeat the point of having the spec in the first place?
>>
>> I presume you are referring to how javac handles constants? I was expecting we would update the specification and implementation accordingly to allow for those i.e. additional captures can occur that are not function parameters and are the result of a constant operations. So the extract+quote produces a valid model but represents a subset of what is possible.
>
>> So the extract+quote produces a valid model but represents a subset of what is possible.
>
> Note we could refine this to detect if the captured value is the result of a constant and extract the constant operation. Something to consider later maybe after the first round.
> I was expecting we would update the specification and implementation accordingly to allow for those i.e. additional captures can occur that are not function parameters and are the result of a constant operations.
That was my expectation as well -- e.g. concretely, I think our goal for this PR is to have `QuotedHelper` use the new methods on the model javac generates, correct?
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/424#discussion_r2112384021
More information about the babylon-dev
mailing list