[code-reflection] RFR: Replace the use of Interpreter to create Quoted instance with specialized code [v5]

Paul Sandoz psandoz at openjdk.org
Fri May 23 00:01:59 UTC 2025


On Thu, 22 May 2025 23:40:22 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> Creating Quoted instance was done by invoking the Interpreter. The Interpreter is too general and if someone could somehow inject any code model we will interpret that as well. This PR replace the use of the interpreter with specialized code.
>
> Mourad Abbay has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision:
> 
>  - Focus on captured values for the moment
>  - Implement quotedOp method

src/jdk.incubator.code/share/classes/jdk/incubator/code/op/CoreOp.java line 4439:

> 4437:     }
> 4438: 
> 4439:     public static FuncOp quoteOp(Op op) {

See also the method `BytecodeGenerator::quote` it does the same thing specific to `LambdaOp`, and we can generalize to `Op` and then the bytecode generator can reuse the general one.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/424#discussion_r2103580823


More information about the babylon-dev mailing list