Skip to main content

with_optimized_program_tiered

Function with_optimized_program_tiered 

Source
pub fn with_optimized_program_tiered<R>(
    input: &str,
    tier: Tier,
    f: impl for<'a> FnOnce(Result<(&'a [Stmt<'a>], &'a TypeRegistry, PolicyRegistry), String>, &'a Interner) -> R,
) -> R
Expand description

with_optimized_program gated by an explicit hotness tier (HOTSWAP §4): the statements pass through crate::optimize::optimize_for_run_tiered at tier. Tier::T3 reproduces with_optimized_program exactly; Tier::T0 skips the optimizer (the baseline tier). The accumulator→loop TCO rewrite is a LANGUAGE SEMANTIC, not an optimization, so it runs at every tier — deep recursion stays constant-stack regardless of the optimization tier.