[code-reflection] RFR: Bytecode round 10

Paul Sandoz psandoz at openjdk.org
Thu Aug 15 21:34:04 UTC 2024


On Wed, 14 Aug 2024 10:40:40 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> This time I focused on the roundtrip stabilizations, namely:
> - BytecodeLift: injected blocks do not pass the stack through block params
> - Avoided redundant slot loads and stores for parameters of blocks with just a single predecessor
> - SlotSSA calculates join point block argument types from the consuming slot load ops (instead of the slot store ops)
> - TestSmallCorpus now performs triple round stability verification and actual numbers are: >99% of methods is stable, no exceptions, no verification errors
> 
> Remaining instability of ~130 methods is related to nested try blocks.
> 
> Please review.
> 
> Thanks,
> Adam

src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 200:

> 198:     private final BitSet blocksToVisit, catchingBlocks;
> 199:     private final Map<Value, Slot> slots;
> 200:     private final Map<Value, Value> valueMap;

Can we rename this or add a comment here as to it use (single predecessor case)?

src/java.base/share/classes/java/lang/reflect/code/bytecode/BytecodeGenerator.java line 1124:

> 1122:                 load(value);
> 1123:             }
> 1124:         } else if (target.predecessors().size() > (target.isEntryBlock() ? 0 : 1)) {

An entry block cannot have any predecessors. Are you observing that? If so its a bug.

test/jdk/java/lang/reflect/code/bytecode/TestSmallCorpus.java line 96:

> 94: 
> 95:         // Roundtrip is >99% stable, no exceptions, no verification errors
> 96:         Assert.assertTrue(stable > 65200 && unstable < 140 && errorStats.isEmpty(), String.format("""

Excellent, really close!

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

PR Review Comment: https://git.openjdk.org/babylon/pull/215#discussion_r1719006650
PR Review Comment: https://git.openjdk.org/babylon/pull/215#discussion_r1719012215
PR Review Comment: https://git.openjdk.org/babylon/pull/215#discussion_r1719024857


More information about the babylon-dev mailing list