[code-reflection] RFR: Bytecode locals compaction [v3]

Paul Sandoz psandoz at openjdk.org
Wed Sep 11 15:07:24 UTC 2024


On Wed, 11 Sep 2024 08:07:51 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 355:
>> 
>>> 353:     // Some of the operations can be deferred
>>> 354:     private boolean canDefer(Op op) {
>>> 355:         Boolean can = deferCache.get(op);
>> 
>> Use `computeIfAbsent`?
>
> Unfortunately `computeIfAbsent` throws `ConcurrentModificationException` in this case. This method is not usable when the computation causes more additions to the map.

Ah of course, its recursive.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/224#discussion_r1754877042


More information about the babylon-dev mailing list