[code-reflection] RFR: Replace the use of Interpreter to create Quoted instance with specialized code [v4]
Mourad Abbay
mabbay at openjdk.org
Wed May 28 10:38:29 UTC 2025
On Thu, 22 May 2025 11:13:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/jdk.incubator.code/share/classes/jdk/incubator/code/op/CoreOp.java line 4477:
>>
>>> 4475:
>>> 4476: b.op(o);
>>> 4477:
>>
>> 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)
>
> Iterating on `m.entrySet` would allow to skip the extra call to `m.get` ?
>
> (an overload in `CopyContext::mapValues` that also accepts a `Map<Value,Value>` also seems fair game here)
> 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)
Maybe when appending an op, we can pass a map of values that overrides the mapping in context temporally ?
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/424#discussion_r2111522551
More information about the babylon-dev
mailing list