Skip to main content

OpCode

Enum OpCode 

Source
#[repr(u8)]
pub enum OpCode {
Show 185 variants PushConst = 0, PushNull = 1, Pop = 2, Dup = 3, Swap = 4, Add = 16, Sub = 17, Mul = 18, Div = 19, Mod = 20, Neg = 21, Pow = 22, BitAnd = 23, BitOr = 24, BitShl = 25, BitShr = 26, BitNot = 27, BitXor = 28, Gt = 32, Lt = 33, Gte = 34, Lte = 35, Eq = 36, Neq = 37, GtInt = 38, GtNumber = 39, GtDecimal = 40, LtInt = 41, LtNumber = 42, LtDecimal = 43, GteInt = 44, GteNumber = 45, GteDecimal = 46, LteInt = 47, And = 48, Or = 49, Not = 50, AddInt = 51, AddNumber = 52, AddDecimal = 53, SubInt = 54, SubNumber = 55, SubDecimal = 56, MulInt = 57, MulNumber = 58, MulDecimal = 59, DivInt = 60, DivNumber = 61, DivDecimal = 62, ModInt = 63, Jump = 64, JumpIfFalse = 65, JumpIfTrue = 66, Call = 67, Return = 68, ReturnValue = 69, CallValue = 70, LoadLocal = 80, StoreLocal = 81, LoadModuleBinding = 82, StoreModuleBinding = 83, LoadClosure = 84, StoreClosure = 85, MakeClosure = 86, CloseUpvalue = 87, MakeRef = 88, DerefLoad = 89, DerefStore = 90, SetIndexRef = 91, BoxLocal = 92, BoxModuleBinding = 93, NewArray = 96, NewObject = 97, GetProp = 98, SetProp = 99, Length = 100, ArrayPush = 101, ArrayPop = 102, MergeObject = 103, SetLocalIndex = 104, SetModuleBindingIndex = 105, ArrayPushLocal = 106, NewMatrix = 107, NewTypedArray = 108, LoopStart = 112, LoopEnd = 113, Break = 114, Continue = 115, IterNext = 116, IterDone = 117, Pattern = 131, CallMethod = 136, PushTimeframe = 137, PopTimeframe = 138, RunSimulation = 139, BuiltinCall = 144, TypeCheck = 145, Convert = 146, ModNumber = 147, ModDecimal = 148, PowInt = 149, PowNumber = 150, PowDecimal = 151, LteNumber = 152, LteDecimal = 153, EqInt = 154, EqNumber = 155, NeqInt = 156, NeqNumber = 157, SetupTry = 160, PopHandler = 161, Throw = 162, TryUnwrap = 163, UnwrapOption = 164, ErrorContext = 165, IsOk = 166, IsErr = 167, UnwrapOk = 168, UnwrapErr = 169, SliceAccess = 176, NullCoalesce = 177, MakeRange = 178, AddTyped = 179, SubTyped = 180, MulTyped = 181, DivTyped = 182, ModTyped = 183, CmpTyped = 184, GetDataField = 192, GetDataRow = 193, GetFieldTyped = 208, SetFieldTyped = 209, NewTypedObject = 210, TypedMergeObject = 211, WrapTypeAnnotation = 212, Yield = 224, Suspend = 225, Resume = 226, Poll = 227, AwaitBar = 228, AwaitTick = 229, Await = 230, SpawnTask = 231, EmitAlert = 232, EmitEvent = 233, JoinInit = 234, JoinAwait = 235, CancelTask = 236, AsyncScopeEnter = 237, AsyncScopeExit = 238, LoadColF64 = 194, LoadColI64 = 195, LoadColBool = 196, LoadColStr = 197, BindSchema = 198, BoxTraitObject = 239, DynMethodCall = 199, DropCall = 200, DropCallAsync = 201, AddIntTrusted = 202, SubIntTrusted = 203, MulIntTrusted = 204, DivIntTrusted = 205, AddNumberTrusted = 206, SubNumberTrusted = 207, MulNumberTrusted = 213, DivNumberTrusted = 214, LoadLocalTrusted = 215, JumpIfFalseTrusted = 216, GtIntTrusted = 217, LtIntTrusted = 218, GteIntTrusted = 219, LteIntTrusted = 220, GtNumberTrusted = 221, LtNumberTrusted = 222, GteNumberTrusted = 223, LteNumberTrusted = 158, Nop = 240, Halt = 241, Debug = 242, IntToNumber = 243, NumberToInt = 244, CallForeign = 245, StoreLocalTyped = 246, CastWidth = 247,
}

Variants§

§

PushConst = 0

Push a constant onto the stack

§

PushNull = 1

Push null onto the stack

§

Pop = 2

Pop value from stack

§

Dup = 3

Duplicate top of stack

§

Swap = 4

Swap top two values

§

Add = 16

Add two numbers

§

Sub = 17

Subtract two numbers

§

Mul = 18

Multiply two numbers

§

Div = 19

Divide two numbers

§

Mod = 20

Modulo operation

§

Neg = 21

Negate number

§

Pow = 22

Power operation

§

BitAnd = 23

Bitwise AND

§

BitOr = 24

Bitwise OR

§

BitShl = 25

Bitwise shift left

§

BitShr = 26

Bitwise shift right

§

BitNot = 27

Bitwise NOT

§

BitXor = 28

Bitwise XOR

§

Gt = 32

Greater than

§

Lt = 33

Less than

§

Gte = 34

Greater than or equal

§

Lte = 35

Less than or equal

§

Eq = 36

Equal

§

Neq = 37

Not equal

§

GtInt = 38

Greater than (int × int → bool)

§

GtNumber = 39

Greater than (f64 × f64 → bool)

§

GtDecimal = 40

Greater than (decimal × decimal → bool)

§

LtInt = 41

Less than (int × int → bool)

§

LtNumber = 42

Less than (f64 × f64 → bool)

§

LtDecimal = 43

Less than (decimal × decimal → bool)

§

GteInt = 44

Greater than or equal (int × int → bool)

§

GteNumber = 45

Greater than or equal (f64 × f64 → bool)

§

GteDecimal = 46

Greater than or equal (decimal × decimal → bool)

§

LteInt = 47

Less than or equal (int × int → bool)

§

And = 48

Logical AND

§

Or = 49

Logical OR

§

Not = 50

Logical NOT

§

AddInt = 51

Add (int × int → int)

§

AddNumber = 52

Add (f64 × f64 → f64)

§

AddDecimal = 53

Add (decimal × decimal → decimal)

§

SubInt = 54

Subtract (int × int → int)

§

SubNumber = 55

Subtract (f64 × f64 → f64)

§

SubDecimal = 56

Subtract (decimal × decimal → decimal)

§

MulInt = 57

Multiply (int × int → int)

§

MulNumber = 58

Multiply (f64 × f64 → f64)

§

MulDecimal = 59

Multiply (decimal × decimal → decimal)

§

DivInt = 60

Divide (int × int → int)

§

DivNumber = 61

Divide (f64 × f64 → f64)

§

DivDecimal = 62

Divide (decimal × decimal → decimal)

§

ModInt = 63

Modulo (int × int → int)

§

Jump = 64

Unconditional jump

§

JumpIfFalse = 65

Jump if false (pop condition)

§

JumpIfTrue = 66

Jump if true (pop condition)

§

Call = 67

Function call

§

Return = 68

Return from function

§

ReturnValue = 69

Return with value

§

CallValue = 70

Call a value (function/closure) from the stack

§

LoadLocal = 80

Load local variable

§

StoreLocal = 81

Store local variable

§

LoadModuleBinding = 82

Load module_binding variable

§

StoreModuleBinding = 83

Store module_binding variable

§

LoadClosure = 84

Load from closure upvalue

§

StoreClosure = 85

Store to closure upvalue

§

MakeClosure = 86

Create a closure with captured upvalues

§

CloseUpvalue = 87

Close upvalue - moves stack local to heap when leaving scope

§

MakeRef = 88

Create a reference to a local variable’s stack slot

§

DerefLoad = 89

Load the value that a reference points to

§

DerefStore = 90

Store a value through a reference

§

SetIndexRef = 91

Set an index on the array that a reference points to (in-place mutation)

§

BoxLocal = 92

Box a local variable into a SharedCell for mutable closure capture. Converts the local slot to a SharedCell (if not already one), then pushes the SharedCell ValueWord onto the stack for MakeClosure to consume.

§

BoxModuleBinding = 93

Box a module binding into a SharedCell for mutable closure capture. Same as BoxLocal but operates on the module_bindings vector.

§

NewArray = 96

Create new array

§

NewObject = 97

Create new object

§

GetProp = 98

Get property/index

§

SetProp = 99

Set property/index

§

Length = 100

Get array/object length

§

ArrayPush = 101

Push value to array

§

ArrayPop = 102

Pop value from array

§

MergeObject = 103

Merge object fields from stack into another object

§

SetLocalIndex = 104

Set index on a local array without loading/cloning through the stack

§

SetModuleBindingIndex = 105

Set index on a module_binding array without loading/cloning through the stack

§

ArrayPushLocal = 106

Push value to array stored in a local variable, mutating in-place

§

NewMatrix = 107

Create a new Matrix from rows*cols f64 values on the stack

§

NewTypedArray = 108

Create a typed array (IntArray/FloatArray/BoolArray) from N homogeneous elements Operand: Count(n) — number of elements to pop At runtime, inspects element types and packs into the appropriate typed array

§

LoopStart = 112

Start of loop (for break/continue)

§

LoopEnd = 113

End of loop

§

Break = 114

Break from loop

§

Continue = 115

Continue to next iteration

§

IterNext = 116

Iterator next

§

IterDone = 117

Check if iterator done

§

Pattern = 131

Pattern match (generic pattern matching, not domain-specific)

§

CallMethod = 136

Call method on value (series.mean(), etc.)

§

PushTimeframe = 137

Push timeframe context

§

PopTimeframe = 138

Pop timeframe context

§

RunSimulation = 139

Execute simulation with config object on stack (generic state simulation)

§

BuiltinCall = 144

Call built-in function

§

TypeCheck = 145

Type check

§

Convert = 146

Convert type

§

ModNumber = 147

Modulo (f64 × f64 → f64)

§

ModDecimal = 148

Modulo (decimal × decimal → decimal)

§

PowInt = 149

Power (int × int → int)

§

PowNumber = 150

Power (f64 × f64 → f64)

§

PowDecimal = 151

Power (decimal × decimal → decimal)

§

LteNumber = 152

Less than or equal (f64 × f64 → bool)

§

LteDecimal = 153

Less than or equal (decimal × decimal → bool)

§

EqInt = 154

Equal (int × int → bool)

§

EqNumber = 155

Equal (f64 × f64 → bool)

§

NeqInt = 156

Not equal (int × int → bool)

§

NeqNumber = 157

Not equal (f64 × f64 → bool)

§

SetupTry = 160

Set up try/catch block (operand: offset to catch handler)

§

PopHandler = 161

Pop exception handler (successful try block completion)

§

Throw = 162

Throw an exception (push error value first)

§

TryUnwrap = 163

Try operator: unified Result/Option propagation with early return on Err/None

§

UnwrapOption = 164

Unwrap Option: extract inner value from Some, panic on None

§

ErrorContext = 165

Add context to Result/Option failures and lift success into Result

§

IsOk = 166

Check whether Result is Ok(value)

§

IsErr = 167

Check whether Result is Err(error)

§

UnwrapOk = 168

Extract inner payload from Ok(value)

§

UnwrapErr = 169

Extract inner payload from Err(error)

§

SliceAccess = 176

Slice access (array[start:end])

§

NullCoalesce = 177

Null coalescing (a ?? b)

§

MakeRange = 178

Range constructor (start..end)

§

AddTyped = 179

Width-typed add: Operand::Width selects I8..F64

§

SubTyped = 180

Width-typed subtract: Operand::Width selects I8..F64

§

MulTyped = 181

Width-typed multiply: Operand::Width selects I8..F64

§

DivTyped = 182

Width-typed divide: Operand::Width selects I8..F64

§

ModTyped = 183

Width-typed modulo: Operand::Width selects I8..F64

§

CmpTyped = 184

Width-typed comparison (ordered): Operand::Width selects I8..F64 Result semantics: pushes -1 (a<b), 0 (a==b), or 1 (a>b)

§

GetDataField = 192

Get field from data row by column index (generic, industry-agnostic)

§

GetDataRow = 193

Get row reference (lightweight, no data copy)

§

GetFieldTyped = 208

Get field from typed object using precomputed offset

§

SetFieldTyped = 209

Set field on typed object using precomputed offset

§

NewTypedObject = 210

Create a new typed object with fields from stack

§

TypedMergeObject = 211

Merge two typed objects into a new typed object

§

WrapTypeAnnotation = 212

Wrap a value with a type annotation for meta formatting

§

Yield = 224

Yield to event loop for cooperative scheduling

§

Suspend = 225

Suspend until a condition is met

§

Resume = 226

Resume from suspension (internal use)

§

Poll = 227

Poll event queue

§

AwaitBar = 228

Await next data bar from a source

§

AwaitTick = 229

Await next timer tick

§

Await = 230

General-purpose await: suspends on Future values

§

SpawnTask = 231

Spawn an async task from the expression on top of stack

§

EmitAlert = 232

Emit an alert to the alert pipeline

§

EmitEvent = 233

Emit a generic event to the event queue

§

JoinInit = 234

Initialize a join group from spawned tasks on the stack

§

JoinAwait = 235

Await a TaskGroup to completion according to its join strategy

§

CancelTask = 236

Cancel a running task

§

AsyncScopeEnter = 237

Enter an async scope (structured concurrency boundary)

§

AsyncScopeExit = 238

Exit an async scope (structured concurrency boundary)

§

LoadColF64 = 194

Load f64 from typed column on a RowView

§

LoadColI64 = 195

Load i64 from typed column on a RowView

§

LoadColBool = 196

Load bool from typed column on a RowView

§

LoadColStr = 197

Load string from typed column on a RowView

§

BindSchema = 198

Bind a DataTable to a TypeSchema at runtime (safety net for dynamic paths)

§

BoxTraitObject = 239

Box a concrete value into a trait object with a vtable

§

DynMethodCall = 199

Call a method on a trait object via vtable dispatch

§

DropCall = 200

Call Drop::drop on the value at the top of stack (sync)

§

DropCallAsync = 201

Call Drop::drop on the value at the top of stack (async)

§

AddIntTrusted = 202

Add (int x int -> int) – trusted: skips runtime type guard

§

SubIntTrusted = 203

Sub (int x int -> int) – trusted: skips runtime type guard

§

MulIntTrusted = 204

Mul (int x int -> int) – trusted: skips runtime type guard

§

DivIntTrusted = 205

Div (int x int -> int) – trusted: skips runtime type guard

§

AddNumberTrusted = 206

Add (f64 x f64 -> f64) – trusted: skips runtime type guard

§

SubNumberTrusted = 207

Sub (f64 x f64 -> f64) – trusted: skips runtime type guard

§

MulNumberTrusted = 213

Mul (f64 x f64 -> f64) – trusted: skips runtime type guard

§

DivNumberTrusted = 214

Div (f64 x f64 -> f64) – trusted: skips runtime type guard

§

LoadLocalTrusted = 215

LoadLocal (trusted) – skips tag validation, reads slot directly

§

JumpIfFalseTrusted = 216

JumpIfFalse (trusted) – condition is known bool, direct bool check

§

GtIntTrusted = 217

Gt (int x int -> bool) – trusted: skips runtime type guard

§

LtIntTrusted = 218

Lt (int x int -> bool) – trusted: skips runtime type guard

§

GteIntTrusted = 219

Gte (int x int -> bool) – trusted: skips runtime type guard

§

LteIntTrusted = 220

Lte (int x int -> bool) – trusted: skips runtime type guard

§

GtNumberTrusted = 221

Gt (f64 x f64 -> bool) – trusted: skips runtime type guard

§

LtNumberTrusted = 222

Lt (f64 x f64 -> bool) – trusted: skips runtime type guard

§

GteNumberTrusted = 223

Gte (f64 x f64 -> bool) – trusted: skips runtime type guard

§

LteNumberTrusted = 158

Lte (f64 x f64 -> bool) – trusted: skips runtime type guard

§

Nop = 240

No operation

§

Halt = 241

Halt execution

§

Debug = 242

Debug breakpoint

§

IntToNumber = 243

Coerce int to number (i64 -> f64)

§

NumberToInt = 244

Coerce number to int (f64 -> i64, truncating)

§

CallForeign = 245

Call a linked foreign function. Dispatches through language runtime extensions or the VM native C ABI path. Operand: ForeignFunction(u16) — index into program.foreign_functions Stack: pops N args (count pushed as a constant by the stub), pushes 1 result

§

StoreLocalTyped = 246

Store a local with width truncation. Operand: TypedLocal(u16, NumericWidth) — local index + width Pops one value, truncates to declared width, stores to local.

§

CastWidth = 247

Cast a value to a specific integer width (bit-truncation, Rust-style as). Operand: Width(NumericWidth) — target width Pops one value, truncates, pushes result.

Implementations§

Source§

impl OpCode

Source

pub const fn category(self) -> OpcodeCategory

Returns the category this opcode belongs to.

Source

pub const fn stack_pops(self) -> u8

Returns the number of values this opcode pops from the stack. Returns 0 for variable-arity opcodes (Call, CallMethod, NewArray, etc.).

Source

pub const fn stack_pushes(self) -> u8

Returns the number of values this opcode pushes onto the stack. Returns 0 for variable-arity opcodes.

Source§

impl OpCode

Source

pub const fn is_trusted(self) -> bool

Returns true if this is a trusted opcode variant (compiler-proved types, no runtime guard).

Source

pub const fn guarded_variant(self) -> Option<OpCode>

Map a trusted opcode back to its guarded (runtime-checked) counterpart.

This is the inverse of trusted_variant(): given a trusted opcode, it returns the equivalent guarded opcode. Used for differential testing and bytecode post-processing.

Source

pub const fn trusted_variant(self) -> Option<OpCode>

Map a guarded typed opcode to its trusted variant (if one exists).

Trait Implementations§

Source§

impl Clone for OpCode

Source§

fn clone(&self) -> OpCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OpCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OpCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for OpCode

Source§

fn eq(&self, other: &OpCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for OpCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for OpCode

Source§

impl Eq for OpCode

Source§

impl StructuralPartialEq for OpCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,