Expand description
Control flow structuring: CFG of basic blocks → nested region tree.
Strategy:
- Iterative dominator computation (Cooper-Harvey-Kennedy).
- Exception ranges grouped by (start, end) span → try regions carved out first; bodies and handlers are structured recursively.
- Inside each flow scope, walk blocks from the entry:
- loop header (back-edge target that dominates the source) → natural loop region,
- conditional terminal → If region (branches structured up to the immediate post-dominator),
- switch terminal → Switch region with per-case sub-scopes,
- forward goto within scope → continue walking at the target,
- edges that leave the scope → Goto nodes (resolved to break/continue/labels in the conversion pass).
Structs§
Enums§
Constants§
- BUDGET_
OVERRIDE - Per-method copy-budget override installed by the method size guard in classdec (pathological copy explosion retry); consumed by Structurer::with_diamonds at construction.
- COPY_
ALLOW_ CONFLUENCE - Set while a SESE consumed-arrival copy runs: there the copy IS the arm’s only emission route (the consumed merge has no sibling owner part in this layout), so the shared-tail-confluence barrier must not truncate it (jdk11/17/26 Pattern.family: the else arm’s copy of the b13 merge tail came out stage-2-less — the bar excluded the 12-pred stage-2 switch head — and the method fell off its end, 缺少返回语句 ×3 trees). Walk-side copy sites never set this.
Statics§
- DOM_
BLOCKS - DOM_
CALLS - Perf instrumentation: how many times the walk recomputed dominators (and over how many blocks). Off by default — the unconditional atomics contended on 7M calls/run.
- DOM_ON
Functions§
- can_
reach_ avoiding - True if
tois reachable fromfromwithout stepping onavoid. - can_
reach_ cfg - Reachability from
fromtotovia normal edges, with a work budget. - can_
reach_ cfg_ barred - Reachability from
fromtotothat never steps on barrier blocks (other thanfromitself). Follows normal AND exception successors (exc_succ), so a protected block whose normal exits all return/throw is still seen to loop back through its handler. - compute_
dominators - group_
exceptions - group_
exceptions_ with - immediate_
postdom - Immediate post-dominator of
entrywithinuniverse, approximated as the nearest reconvergence point: the block (other than entry) reachable from ALL of entry’s in-universe successors with the smallest total BFS distance. Blocks whose in-universe successors are empty are exits. - reachable_
within - Blocks normally reachable from
entrywithout enteringstop. - reverse_
postorder - set_
budget_ override - Install/clear the per-method copy-budget override (see BUDGET_OVERRIDE).
- set_
dom_ counters - Enable dominator-recompute counters (diagnostics).
- set_
walk_ deadline - Install/clear the per-method walk deadline.
- set_
walk_ visit_ budget - Install/clear the per-method walk visit budget.