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

Adam Sotona asotona at openjdk.org
Thu Jan 15 17:59:21 UTC 2026


On Mon, 12 Jan 2026 12:06:04 GMT, Adam Sotona <asotona at openjdk.org> wrote:

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

This pull request has now been integrated.

Changeset: 2117de8d
Author:    Adam Sotona <asotona at openjdk.org>
URL:       https://git.openjdk.org/babylon/commit/2117de8d3ae5ec009d700bacd2cd79d3dadc6f1f
Stats:     202 lines in 3 files changed: 183 ins; 1 del; 18 mod

Improved NormalizeBlocksTransformer and its application in BytecodeGenerator.

Reviewed-by: psandoz

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

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


More information about the babylon-dev mailing list