[][src]Enum koto_bytecode::Instruction

pub enum Instruction {
    Error {
        message: String,
    },
    Copy {
        target: u8,
        source: u8,
    },
    SetEmpty {
        register: u8,
    },
    SetBool {
        register: u8,
        value: bool,
    },
    SetNumber {
        register: u8,
        value: i64,
    },
    LoadFloat {
        register: u8,
        constant: ConstantIndex,
    },
    LoadInt {
        register: u8,
        constant: ConstantIndex,
    },
    LoadString {
        register: u8,
        constant: ConstantIndex,
    },
    LoadGlobal {
        register: u8,
        constant: ConstantIndex,
    },
    SetGlobal {
        global: ConstantIndex,
        source: u8,
    },
    Import {
        register: u8,
        constant: ConstantIndex,
    },
    MakeTuple {
        register: u8,
        start: u8,
        count: u8,
    },
    MakeTempTuple {
        register: u8,
        start: u8,
        count: u8,
    },
    MakeList {
        register: u8,
        size_hint: usize,
    },
    MakeMap {
        register: u8,
        size_hint: usize,
    },
    MakeNum2 {
        register: u8,
        count: u8,
        element_register: u8,
    },
    MakeNum4 {
        register: u8,
        count: u8,
        element_register: u8,
    },
    Range {
        register: u8,
        start: u8,
        end: u8,
    },
    RangeInclusive {
        register: u8,
        start: u8,
        end: u8,
    },
    RangeTo {
        register: u8,
        end: u8,
    },
    RangeToInclusive {
        register: u8,
        end: u8,
    },
    RangeFrom {
        register: u8,
        start: u8,
    },
    RangeFull {
        register: u8,
    },
    MakeIterator {
        register: u8,
        iterable: u8,
    },
    Function {
        register: u8,
        arg_count: u8,
        capture_count: u8,
        instance_function: bool,
        variadic: bool,
        generator: bool,
        size: usize,
    },
    Capture {
        function: u8,
        target: u8,
        source: u8,
    },
    LoadCapture {
        register: u8,
        capture: u8,
    },
    SetCapture {
        capture: u8,
        source: u8,
    },
    Negate {
        register: u8,
        source: u8,
    },
    Add {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Subtract {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Multiply {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Divide {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Modulo {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Less {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    LessOrEqual {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Greater {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    GreaterOrEqual {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Equal {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    NotEqual {
        register: u8,
        lhs: u8,
        rhs: u8,
    },
    Jump {
        offset: usize,
    },
    JumpIf {
        register: u8,
        offset: usize,
        jump_condition: bool,
    },
    JumpBack {
        offset: usize,
    },
    JumpBackIf {
        register: u8,
        offset: usize,
        jump_condition: bool,
    },
    Call {
        result: u8,
        function: u8,
        frame_base: u8,
        arg_count: u8,
    },
    CallChild {
        result: u8,
        function: u8,
        frame_base: u8,
        arg_count: u8,
        parent: u8,
    },
    Return {
        register: u8,
    },
    Yield {
        register: u8,
    },
    Size {
        register: u8,
        value: u8,
    },
    IterNext {
        register: u8,
        iterator: u8,
        jump_offset: usize,
    },
    IterNextTemp {
        register: u8,
        iterator: u8,
        jump_offset: usize,
    },
    IterNextQuiet {
        iterator: u8,
        jump_offset: usize,
    },
    ValueIndex {
        register: u8,
        value: u8,
        index: i8,
    },
    SliceFrom {
        register: u8,
        value: u8,
        index: i8,
    },
    SliceTo {
        register: u8,
        value: u8,
        index: i8,
    },
    IsTuple {
        register: u8,
        value: u8,
    },
    IsList {
        register: u8,
        value: u8,
    },
    ListPushValue {
        list: u8,
        value: u8,
    },
    ListPushValues {
        list: u8,
        values_start: u8,
        count: u8,
    },
    ListUpdate {
        list: u8,
        index: u8,
        value: u8,
    },
    Index {
        register: u8,
        value: u8,
        index: u8,
    },
    MapInsert {
        register: u8,
        value: u8,
        key: ConstantIndex,
    },
    Access {
        register: u8,
        map: u8,
        key: ConstantIndex,
    },
    TryStart {
        arg_register: u8,
        catch_offset: usize,
    },
    TryEnd,
    Debug {
        register: u8,
        constant: ConstantIndex,
    },
    CheckType {
        register: u8,
        type_id: TypeId,
    },
    CheckSize {
        register: u8,
        size: usize,
    },
}

Decoded instructions produced by an InstructionReader for execution in the runtime

Variants

Error

Fields of Error

message: String
Copy

Fields of Copy

target: u8source: u8
SetEmpty

Fields of SetEmpty

register: u8
SetBool

Fields of SetBool

register: u8value: bool
SetNumber

Fields of SetNumber

register: u8value: i64
LoadFloat

Fields of LoadFloat

register: u8constant: ConstantIndex
LoadInt

Fields of LoadInt

register: u8constant: ConstantIndex
LoadString

Fields of LoadString

register: u8constant: ConstantIndex
LoadGlobal

Fields of LoadGlobal

register: u8constant: ConstantIndex
SetGlobal

Fields of SetGlobal

global: ConstantIndexsource: u8
Import

Fields of Import

register: u8constant: ConstantIndex
MakeTuple

Fields of MakeTuple

register: u8start: u8count: u8
MakeTempTuple

Fields of MakeTempTuple

register: u8start: u8count: u8
MakeList

Fields of MakeList

register: u8size_hint: usize
MakeMap

Fields of MakeMap

register: u8size_hint: usize
MakeNum2

Fields of MakeNum2

register: u8count: u8element_register: u8
MakeNum4

Fields of MakeNum4

register: u8count: u8element_register: u8
Range

Fields of Range

register: u8start: u8end: u8
RangeInclusive

Fields of RangeInclusive

register: u8start: u8end: u8
RangeTo

Fields of RangeTo

register: u8end: u8
RangeToInclusive

Fields of RangeToInclusive

register: u8end: u8
RangeFrom

Fields of RangeFrom

register: u8start: u8
RangeFull

Fields of RangeFull

register: u8
MakeIterator

Fields of MakeIterator

register: u8iterable: u8
Function

Fields of Function

register: u8arg_count: u8capture_count: u8instance_function: boolvariadic: boolgenerator: boolsize: usize
Capture

Fields of Capture

function: u8target: u8source: u8
LoadCapture

Fields of LoadCapture

register: u8capture: u8
SetCapture

Fields of SetCapture

capture: u8source: u8
Negate

Fields of Negate

register: u8source: u8
Add

Fields of Add

register: u8lhs: u8rhs: u8
Subtract

Fields of Subtract

register: u8lhs: u8rhs: u8
Multiply

Fields of Multiply

register: u8lhs: u8rhs: u8
Divide

Fields of Divide

register: u8lhs: u8rhs: u8
Modulo

Fields of Modulo

register: u8lhs: u8rhs: u8
Less

Fields of Less

register: u8lhs: u8rhs: u8
LessOrEqual

Fields of LessOrEqual

register: u8lhs: u8rhs: u8
Greater

Fields of Greater

register: u8lhs: u8rhs: u8
GreaterOrEqual

Fields of GreaterOrEqual

register: u8lhs: u8rhs: u8
Equal

Fields of Equal

register: u8lhs: u8rhs: u8
NotEqual

Fields of NotEqual

register: u8lhs: u8rhs: u8
Jump

Fields of Jump

offset: usize
JumpIf

Fields of JumpIf

register: u8offset: usizejump_condition: bool
JumpBack

Fields of JumpBack

offset: usize
JumpBackIf

Fields of JumpBackIf

register: u8offset: usizejump_condition: bool
Call

Fields of Call

result: u8function: u8frame_base: u8arg_count: u8
CallChild

Fields of CallChild

result: u8function: u8frame_base: u8arg_count: u8parent: u8
Return

Fields of Return

register: u8
Yield

Fields of Yield

register: u8
Size

Fields of Size

register: u8value: u8
IterNext

Fields of IterNext

register: u8iterator: u8jump_offset: usize
IterNextTemp

Fields of IterNextTemp

register: u8iterator: u8jump_offset: usize
IterNextQuiet

Fields of IterNextQuiet

iterator: u8jump_offset: usize
ValueIndex

Fields of ValueIndex

register: u8value: u8index: i8
SliceFrom

Fields of SliceFrom

register: u8value: u8index: i8
SliceTo

Fields of SliceTo

register: u8value: u8index: i8
IsTuple

Fields of IsTuple

register: u8value: u8
IsList

Fields of IsList

register: u8value: u8
ListPushValue

Fields of ListPushValue

list: u8value: u8
ListPushValues

Fields of ListPushValues

list: u8values_start: u8count: u8
ListUpdate

Fields of ListUpdate

list: u8index: u8value: u8
Index

Fields of Index

register: u8value: u8index: u8
MapInsert

Fields of MapInsert

register: u8value: u8key: ConstantIndex
Access

Fields of Access

register: u8map: u8key: ConstantIndex
TryStart

Fields of TryStart

arg_register: u8catch_offset: usize
TryEnd
Debug

Fields of Debug

register: u8constant: ConstantIndex
CheckType

Fields of CheckType

register: u8type_id: TypeId
CheckSize

Fields of CheckSize

register: u8size: usize

Trait Implementations

impl Debug for Instruction[src]

impl Display for Instruction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.