pub enum RuntimeInstruction {
Show 42 variants
Span(u32, u32, u32),
Label,
FunctionStart,
FunctionEnd,
Breakpoint,
Branch(u32),
ConditionalBranch(u32, u32),
Return(u32),
IndirectCall,
Call(u32, u32),
Halt,
Print,
Load(Type, u32),
Store(Type, u32),
Dup,
HeapAlloc(u32),
GetItem,
HeapDealloc,
Const(Value),
Add(Type),
Sub(Type),
Mul(Type),
Div(Type),
Rem(Type),
Neg(Type),
Shl(Type),
Shr(Type),
Rol(Type),
Ror(Type),
BitAnd(Type),
BitOr(Type),
BitXor(Type),
Not,
And,
Or,
Xor,
Eq(Type),
Ne(Type),
Lt(Type),
Gt(Type),
Le(Type),
Ge(Type),
}Expand description
Runtime bytecode instructions.
Source text parses into the separate SurfaceInstruction enum below.
Keeping the source and runtime forms separate lets patterns carry symbolic
names and surface types until a resolver converts them to runtime values.
Runtime variant order remains stable because it determines derived opcodes.
Variants§
Span(u32, u32, u32)
span file:file_id start:u32 end:u32
span 0 1 2 — three space-separated u32s.
Label
Label definition.
FunctionStart
func_start <name> — marks function entry. <name> is symbolic and
orchestrator-resolved; the unit variant carries no payload.
FunctionEnd
func_end <name> — marks function exit (debug only).
Breakpoint
breakpoint. Must precede Branch (whose token br would be a
prefix of breakpoint).
Branch(u32)
br <target> — symbolic. Deferred to orchestrator.
ConditionalBranch(u32, u32)
cond_br <true_target>, <false_target> — symbolic. Deferred.
Return(u32)
ret (bare) is the form real .sst uses; numeric ret <n> has no
precedent so we defer. Orchestrator emits Return(0) for bare ret.
IndirectCall
call_indirect. Must precede Call for the prefix check.
Call(u32, u32)
call <arity>, <addr> — symbolic addr. Deferred.
Halt
halt — stop execution.
print — write top-of-stack to stdout.
Load(Type, u32)
load.<type> <address> — two fields with single-space separator.
Store(Type, u32)
store.<type> <address>.
Dup
dup.
HeapAlloc(u32)
heap_alloc <n>.
GetItem
get_item. Must precede Ge (token ge ⊂ get_item).
HeapDealloc
heap_dealloc — pops a HeapRef and marks the slot dead, returning it
to the free list for reuse by the next heap_alloc.
Const(Value)
const.<type> <literal> — numeric/bool only here. .str/.fn_ref/
.heap_ref are orchestrator-handled.
Add(Type)
Sub(Type)
Mul(Type)
Div(Type)
Rem(Type)
Neg(Type)
Shl(Type)
Shr(Type)
Rol(Type)
Ror(Type)
BitAnd(Type)
BitOr(Type)
BitXor(Type)
Not
And
Or
Xor
Eq(Type)
Ne(Type)
Lt(Type)
Gt(Type)
Le(Type)
Ge(Type)
Trait Implementations§
Source§impl CanonicalInstructionSyntax for RuntimeInstruction
impl CanonicalInstructionSyntax for RuntimeInstruction
Source§impl Clone for RuntimeInstruction
impl Clone for RuntimeInstruction
Source§fn clone(&self) -> RuntimeInstruction
fn clone(&self) -> RuntimeInstruction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeInstruction
impl Debug for RuntimeInstruction
Source§impl Display for RuntimeInstruction
impl Display for RuntimeInstruction
Source§impl<T: Into<Value>> From<T> for RuntimeInstruction
impl<T: Into<Value>> From<T> for RuntimeInstruction
Source§impl FromBytesWithOpcode for RuntimeInstruction
impl FromBytesWithOpcode for RuntimeInstruction
Source§impl PartialEq for RuntimeInstruction
impl PartialEq for RuntimeInstruction
Source§fn eq(&self, other: &RuntimeInstruction) -> bool
fn eq(&self, other: &RuntimeInstruction) -> bool
self and other values to be equal, and is used by ==.Source§impl WriteBytes for RuntimeInstruction
impl WriteBytes for RuntimeInstruction
impl StructuralPartialEq for RuntimeInstruction
Auto Trait Implementations§
impl Freeze for RuntimeInstruction
impl RefUnwindSafe for RuntimeInstruction
impl Send for RuntimeInstruction
impl Sync for RuntimeInstruction
impl Unpin for RuntimeInstruction
impl UnsafeUnpin for RuntimeInstruction
impl UnwindSafe for RuntimeInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromBytes for Twhere
T: FromBytesWithOpcode,
impl<T> FromBytes for Twhere
T: FromBytesWithOpcode,
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].