Skip to main content

Instruction

Enum Instruction 

Source
pub enum Instruction {
Show 39 variants LoadBool(usize, bool), LoadInt(usize, i32), LoadLong(usize, i64), LoadFloat(usize, f32), LoadDouble(usize, f64), LoadObject(usize, usize), LoadConst(usize, usize), LoadGlobal(usize, usize), LoadAt(usize, usize, usize), LoadSuper(usize, usize, usize), Move(usize, usize), Store(usize, usize, usize), StoreAt(usize, usize, usize), StoreGlobal(usize, usize), Jump(usize), JumpF(usize, usize), JumpT(usize, usize), Goto(usize), GotoT(usize, usize), GotoF(usize, usize), PushArg(usize), Call(usize, usize, usize), Add(usize, usize, usize), Sub(usize, usize, usize), Mul(usize, usize, usize), Div(usize, usize, usize), Gt(usize, usize, usize), Lt(usize, usize, usize), Ge(usize, usize, usize), Le(usize, usize, usize), Eq(usize, usize, usize), Ret0, Ret(usize), Label(usize), BitOr(usize, usize, usize), BitXor(usize, usize, usize), BitAnd(usize, usize, usize), And(usize, usize, usize), Or(usize, usize, usize),
}

Variants§

§

LoadBool(usize, bool)

LoadBool R(A) = B

Loading bool value B to register A

§

LoadInt(usize, i32)

LoadInt R(A) = B

Loading integer value B to register A

§

LoadLong(usize, i64)

LoadLong R(A) = B

Loading long value B to register A

§

LoadFloat(usize, f32)

LoadFloat R(A) = B

Loading float value B to register A

§

LoadDouble(usize, f64)

LoadDouble R(A) = B

Loading double value B to register A

§

LoadObject(usize, usize)

§

LoadConst(usize, usize)

LoadConst R(A) = C(B)

Load constant from object pool to register A

§

LoadGlobal(usize, usize)

LoadGlobal R(A) = G(B)

Load global value B into register A

§

LoadAt(usize, usize, usize)

LoadAt R(A) = R(B)[C]

Load C from B and store in A

§

LoadSuper(usize, usize, usize)

LoadSuper R(A) = R(B)[C]

Load C from B and store in A

§

Move(usize, usize)

Move R(A) = R(B)

Move register

§

Store(usize, usize, usize)

Store R(B)[C] = A

Store A into R(B)[C]

§

StoreAt(usize, usize, usize)

§

StoreGlobal(usize, usize)

StoreGlobal G(A) = R(B)

Store global

§

Jump(usize)

Jump IP

§

JumpF(usize, usize)

Jump (R(A) == false ? ip = B : continue)

§

JumpT(usize, usize)

Jump (R(A) == true ? ip == B : continue)

§

Goto(usize)

Goto

Same as Jump instructions, but uses labels

§

GotoT(usize, usize)

§

GotoF(usize, usize)

§

PushArg(usize)

Push value from R(A) to arguments stack

§

Call(usize, usize, usize)

R(A) = B(Args), C - Arg count, args poped from arg stack

§

Add(usize, usize, usize)

Add R(A) = R(B) + R(C)

§

Sub(usize, usize, usize)

Sub R(A) = R(B) - R(C)

§

Mul(usize, usize, usize)

Mul R(A) = R(B) * R(C)

§

Div(usize, usize, usize)

Div R(A) = R(B) / R(C)

§

Gt(usize, usize, usize)

Gt R(A) = R(B) > R(C)

§

Lt(usize, usize, usize)

Lt R(A) = R(B) < R(C)

§

Ge(usize, usize, usize)

Ge R(A) = R(B) >= R(C)

§

Le(usize, usize, usize)

Le R(A) = R(B) <= R(C)

§

Eq(usize, usize, usize)

Eq R(A) = R(B) == R(C)

§

Ret0

Ret0

return null value

§

Ret(usize)

Ret R(A)

return value from R(A)

§

Label(usize)

Create label with id A

§

BitOr(usize, usize, usize)

§

BitXor(usize, usize, usize)

§

BitAnd(usize, usize, usize)

§

And(usize, usize, usize)

§

Or(usize, usize, usize)

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Instruction

Source§

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

Formats the value using the given formatter. Read more

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.