Skip to main content

compile_program

Function compile_program 

Source
pub fn compile_program(
    items: &[ResolvedTopLevel],
    symbols: &SymbolTable,
    arena: &mut Arena,
    analysis: Option<&AnalysisResult>,
) -> Result<(CodeStore, Vec<NanValue>), CompileError>
Expand description

Compile a resolved program into bytecode.

items is the entry’s resolved HIR (the output of the NameResolve pipeline stage). symbols is the entry’s symbol table — every ResolvedCallee::Fn(FnId) / ResolvedCtor::User in the resolved tree resolves through it to a canonical name that the VM dispatches against.

analysis carries per-fn FnAnalysis.allocates from the pipeline’s analyze stage; the VM compiler reads chunk.no_alloc from it directly.