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

Adam Sotona asotona at openjdk.org
Wed Jan 14 19:04:22 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:

  fixed javadoc

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

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

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

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 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