[−][src]Enum gluon_vm::types::Instruction
Enum which represent the instructions executed by the virtual machine.
The binary arithmetic instructions pop two values of the stack and then push the result.
Variants
PushInt(VmInt)
Push an integer to the stack
PushByte(u8)
Push a byte to the stack
PushFloat(EqFloat)
Push a float to the stack
PushString(VmIndex)
Push a string to the stack by loading the string at index
in the currently executing
function
PushUpVar(VmIndex)
Push a variable to the stack by loading the upvariable at index
from the currently
executing function
Push(VmIndex)
Push the value at index
Call(VmIndex)
Call a function by passing it args
number of arguments. The function is at the index in
the stack just before the arguments. After the call is all arguments are removed and the
function is replaced by the result of the call.
TailCall(VmIndex)
Tailcalls a function, removing the current stack frame before calling it.
See Call
.
Constructs a data value tagged by tag
by taking the top args
values of the stack.
Fields of ConstructVariant
Fields of ConstructPolyVariant
Fields of NewVariant
Fields of NewRecord
Fields of CloseData
index: VmIndex
Where the record is located
Fields of ConstructRecord
ConstructArray(VmIndex)
Constructs an array containing args
values.
GetOffset(VmIndex)
Retrieves the field at offset
of an object at the top of the stack. The result of the
field access replaces the object on the stack.
GetField(VmIndex)
Retrieves the field of a polymorphic record by retrieving the string constant at index
and using that to retrieve lookup the field. The result of the
field access replaces the object on the stack.
Splits a object, pushing all contained values to the stack.
TestTag(VmTag)
Tests if the value at the top of the stack is tagged with tag
. Pushes True
if the tag
matches, otherwise False
TestPolyTag(VmIndex)
Jump(VmIndex)
Jumps to the instruction at index
in the currently executing function.
CJump(VmIndex)
Jumps to the instruction at index
in the currently executing function if True
is at the
top of the stack and pops that value.
Pop(VmIndex)
Pops the top n
values from the stack.
Slide(VmIndex)
Pops the top value from the stack, then pops n
more values, finally the first value is
pushed back to the stack.
Creates a closure with the function at function_index
of the currently executing function
and upvars
upvariables popped from the top of the stack.
Fields of MakeClosure
Creates a closure with the function at function_index
of the currently executing
function. The closure has room for upvars
upvariables but these are not filled until the
matching call to ClosureClosure
is executed.
Fields of NewClosure
CloseClosure(VmIndex)
Fills the previously allocated closure with n
upvariables.
Implementations
impl Instruction
[src]
pub fn adjust(&self) -> i32
[src]
Returns by how much the stack is adjusted when executing the instruction self
.
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
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 Eq for Instruction
[src]
impl Hash for Instruction
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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 StructuralEq for Instruction
[src]
impl StructuralPartialEq for Instruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<Id> AsId<Id> for Id where
Id: ?Sized,
[src]
Id: ?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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'_, T> Captures<'_> for T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
[src]
type Remainder = Choices
fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastArc for T where
T: Downcast + Send + Sync,
[src]
T: Downcast + Send + Sync,
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<D, T> FromPtr<D> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
[src]
U: LiftFrom<T, I>,
impl<Source> Sculptor<HNil, HNil> for Source
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,