Skip to main content

specialize_function

Function specialize_function 

Source
pub fn specialize_function(
    func_name: &str,
    ops: &[WasmOp],
    block_arity: &[(u8, u8)],
    facts: &[WscFact],
    params_i64: &[bool],
    linear_memory_bytes: u32,
) -> FactSpecResult
Expand description

Specialize one function’s op stream against its wsc.facts premises.

block_arity is the decoder’s ordinal side-table (one (params, results) entry per Block/Loop/If in op order); facts is the per-function slice (CompileConfig::current_func_facts); params_i64 is the declared param-width table (CompileConfig::current_func_params_i64true ⇒ param k is 64-bit), which fixes the symbolic width of a param local.get (Phase 2b tracks i64 divisors); linear_memory_bytes is the module’s DECLARED minimum linear-memory size in bytes (CompileConfig::linear_memory_bytes; 0 = unknown — every memory bounds-guard obligation then declines loudly). Total: every input yields a result — inapplicable shapes surface as loud declines, never errors.