Enum lovm2_core::Instruction [−][src]
Definition of the bytecode
Variants
LPush(u16)
Push local variable.
GPush(u16)
Push global variable.
CPush(u16)
Push constant.
LMove(u16)
Store into local variable.
GMove(u16)
Store into global variable.
Drops the value on top of stack.
Duplicates top of stack.
Get first argument as key from second argument and push it.
Get first argument as key from second argument by reference and push it.
Write second argument into first argument which must be a reference.
= first + second
= first - second
= first * second
= first / second
= first ** second
= first % second
Logical shift left first
by second
places.
Logical shift right first
by second
places.
Logical and for Bool
, Bitwise and for Int
.
Logical or for Bool
, Bitwise or for Int
.
Logical xor for Bool
, Bitwise xor for Int
.
Logical not for Bool
, Bitwise not for Int
.
= first == second
= first != second
= first >= second
= first > second
= first <= second
= first < second
Jmp(u16)
Jump to instruction offset.
Jt(u16)
Jump to instruction offset if top of stack is true.
Jf(u16)
Jump to instruction offset if top of stack is false.
Call function with ident index
, argn
.
Call a function in the same module.
Return early from a code object.
Interrupt(u16)
Trigger interrupt n
.
Conv(u16)
Convert top of stack into type. See Value::type_id
.
Take top of stack as name of module to load and import functions without module prefix as well.
Take top of stack as name of module to import. Function name will be padded using the import hook.
Turn the value on stack into a referenceable value. Lists and dicts are boxed deeply.
Create a new list from the first argument on stack. Second is starting index or nil, third is end index (exclusive) or nil.
Create a new iterator from the first argument on stack.
Create a new ranged iterator using the first argument as from
and second argument as to
.
on of the arguments is allowed to be nil.
Consumes the iterator on top of stack and leaves a bool on top if the iterator has another element.
Consumes the iterator on top of stack and returns the next value if any.
Consumes the iterator on top of stack and create a new one in reverse.
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Instruction
[src]
impl Debug for Instruction
[src]
impl<'de> Deserialize<'de> for Instruction
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Instruction> for Instruction
[src]
fn eq(&self, other: &Instruction) -> bool
[src]
fn ne(&self, other: &Instruction) -> bool
[src]
impl Serialize for Instruction
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Instruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instruction
[src]
impl Send for Instruction
[src]
impl Sync for Instruction
[src]
impl Unpin for Instruction
[src]
impl UnwindSafe for Instruction
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,