pub enum Op {
Show 62 variants
PushConst(u32),
Pop,
Dup,
LoadLocal(u16),
StoreLocal(u16),
MakeRecord {
field_name_indices: Vec<u32>,
},
MakeTuple(u16),
MakeList(u32),
MakeVariant {
name_idx: u32,
arity: u16,
},
GetField(u32),
GetElem(u16),
TestVariant(u32),
GetVariant(u32),
GetVariantArg(u16),
GetListLen,
GetListElem(u32),
ListAppend,
GetListElemDyn,
Jump(i32),
JumpIf(i32),
JumpIfNot(i32),
Call {
fn_id: u32,
arity: u16,
node_id_idx: u32,
},
TailCall {
fn_id: u32,
arity: u16,
node_id_idx: u32,
},
MakeClosure {
fn_id: u32,
capture_count: u16,
},
CallClosure {
arity: u16,
node_id_idx: u32,
},
EffectCall {
kind_idx: u32,
op_idx: u32,
arity: u16,
node_id_idx: u32,
},
Return,
Panic(u32),
IntAdd,
IntSub,
IntMul,
IntDiv,
IntMod,
IntNeg,
IntEq,
IntLt,
IntLe,
FloatAdd,
FloatSub,
FloatMul,
FloatDiv,
FloatNeg,
FloatEq,
FloatLt,
FloatLe,
NumAdd,
NumSub,
NumMul,
NumDiv,
NumMod,
NumNeg,
NumEq,
NumLt,
NumLe,
BoolAnd,
BoolOr,
BoolNot,
StrConcat,
StrLen,
StrEq,
BytesLen,
BytesEq,
}Variants§
PushConst(u32)
Pop
Dup
LoadLocal(u16)
StoreLocal(u16)
MakeRecord
Builds a record from count (name_const_idx, value) pairs on the stack.
Stack: [name_idx_n, val_n, …, name_idx_1, val_1] but encoded as
alternating <name_idx_const_u32> <value popped from stack> — for
simplicity we instead push count values and count field name
constants in the same op as a Vec<u32> of name indices.
MakeTuple(u16)
MakeList(u32)
MakeVariant
GetField(u32)
GetElem(u16)
TestVariant(u32)
GetVariant(u32)
GetVariantArg(u16)
GetListLen
GetListElem(u32)
ListAppend
Pop [list, value]; push list with value appended.
GetListElemDyn
Pop list; push it indexed by the integer on top. Stack: [list, idx] → [list[idx]]. (Like GetListElem(u32) but the index is dynamic.)
Jump(i32)
JumpIf(i32)
JumpIfNot(i32)
Call
TailCall
MakeClosure
Build a Value::Closure: pop capture_count values (in order) and
pair them with fn_id.
CallClosure
Call a closure: pop arity args + 1 closure (top of stack), invoke.
EffectCall
EFFECT_CALL <effect_kind_const_idx> <op_name_const_idx> <arity>.
Pops arity args, dispatches to a host effect handler, pushes result.
node_id_idx points to a Const::NodeId for trace keying.