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

Paul Sandoz psandoz at openjdk.org
Tue May 13 20:26:34 UTC 2025


On Mon, 12 May 2025 15:10:21 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.

src/jdk.incubator.code/share/classes/jdk/incubator/code/interpreter/Interpreter.java line 230:

> 228:     }
> 229: 
> 230:     public static final class VarBox

You don't need to make this public. Look what it implements and provide your own implementation.

Separately, we likely need to address how we expose a runtime value correspond to a symbolic `Var` value. We will encounter similar issues with tuples and funcs, so we need some general mapping i expect. This may become easier to identify as we refactor the code base more cleanly into dialects.

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

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


More information about the babylon-dev mailing list