pub struct Function {
pub name: String,
pub arity: u16,
pub locals_count: u16,
pub code: Vec<Op>,
pub effects: Vec<DeclaredEffect>,
pub body_hash: BodyHash,
pub refinements: Vec<Option<Refinement>>,
pub field_ic_sites: u16,
}Fields§
§name: String§arity: u16§locals_count: u16§code: Vec<Op>§effects: Vec<DeclaredEffect>Declared effects on this function’s signature (spec §7).
body_hash: BodyHashContent hash of the bytecode body — see compute_body_hash.
Populated at the end of the compile pass; used at Op::MakeClosure
to give every Value::Closure a canonical identity that does not
depend on the closure literal’s source location (#222).
refinements: Vec<Option<Refinement>>Per-parameter refinement predicates (#209 slice 3). Some(r)
for params declared with Type{x | predicate}, None
otherwise. The VM evaluates these at Op::Call time before
pushing the frame; failure raises VmError::RefinementFailed
and the tracer records a verdict event with the same shape
as a runtime gate’s gate.verdict.
field_ic_sites: u16Number of Op::GetField sites in this function (#462 slice 1).
Populated by the compiler so the VM can lazily one-shot
allocate the inline-cache Vec<Option<usize>> to its final
size on first GetField — no per-op resize bookkeeping.
#[serde(default)] because pre-#462 programs don’t carry it.