[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 11:12:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> 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)

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)

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

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


More information about the babylon-dev mailing list