pub struct FnChunk {
pub name: String,
pub arity: u8,
pub local_count: u16,
pub code: Vec<u8>,
pub constants: Vec<NanValue>,
pub effects: Vec<u32>,
pub thin: bool,
pub parent_thin: bool,
pub leaf: bool,
pub no_alloc: bool,
pub source_file: String,
pub line_table: Vec<(u16, u16)>,
}Expand description
A compiled function chunk — bytecode + metadata.
Fields§
§name: String§arity: u8§local_count: u16§code: Vec<u8>§constants: Vec<NanValue>§effects: Vec<u32>Declared effects (e.g. ! [Console.print, Http]). Empty for pure functions.
thin: boolConservatively classified “thin” function: likely to return without creating any frame-local heap survivors or dirtying globals.
parent_thin: boolNarrow wrapper-like helper that borrows the caller young region and skips ordinary-return handoff as long as it stays out of yard/handoff.
leaf: boolLeaf function: no CALL_KNOWN or CALL_VALUE in bytecode (only builtins and opcodes). When also thin and args-only (local_count == arity), can be called without pushing a CallFrame.
no_alloc: boolPure no-alloc function (per shared ir::compute_alloc_info under
VmAllocPolicy): the body never produces a heap object. Disjoint from
thin because mutual-TCO peers can be no-alloc but not bytecode-thin.
TAIL_CALL_KNOWN skips finalize_frame_locals_for_tail_call when
the target chunk has this flag set — the runtime guard is guaranteed
to be a no-op for pure no-alloc bodies.
source_file: StringSource file path for this function (empty for synthetic/unknown).
line_table: Vec<(u16, u16)>Run-length encoded line table: (bytecode_offset, source_line).
Sorted by offset. Lookup: find last entry where offset <= target ip.