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

Maurizio Cimadamore mcimadamore at openjdk.org
Thu May 22 11:17:21 UTC 2025


On Thu, 22 May 2025 02:50:07 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 updated the pull request incrementally with one additional commit since the last revision:
> 
>   Implement quotedOp method

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

> 4476:                 b.op(o);
> 4477: 
> 4478:                 for (Value k : m.keySet()) {

Why is this loop needed? Is this to restore the original mapping in the copy context? If so, perhaps the code could be strengthened by surrounding `b.op` with a `try/finally` and then restore the mapping in the finally block?

(But I wonder if the API could offer more help here -- e.g. some kind of temp value mapping)

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

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


More information about the babylon-dev mailing list