[code-reflection] RFR: Improved NormalizeBlocksTransformer and its application in BytecodeGenerator. [v4]

Adam Sotona asotona at openjdk.org
Wed Jan 14 18:59:55 UTC 2026


> Lowering of pattern matching in switch statements and expressions produces an inefficient tree of conditional branches. This PR does not improve the lowering itself; however, it reduces overhead in the generated bytecode. 
> 
> `NormalizeBlocksTransformer` is improved to handle redundant conditional branches. It skips intermediate conditional branches with constant boolean arguments and re-targets them directly to the true or false branch, based on the argument's constant value.
> 
> The `BytecodeGenerator` prepends `NormalizeBlocksTransformer` to leverage the optimized models for bytecode generation.

Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:

  added test

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

Changes:
  - all: https://git.openjdk.org/babylon/pull/829/files
  - new: https://git.openjdk.org/babylon/pull/829/files/ba727ee8..3ad46226

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=babylon&pr=829&range=03
 - incr: https://webrevs.openjdk.org/?repo=babylon&pr=829&range=02-03

  Stats: 133 lines in 1 file changed: 133 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/babylon/pull/829.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/829/head:pull/829

PR: https://git.openjdk.org/babylon/pull/829


More information about the babylon-dev mailing list