[−][src]Enum runestick::Inst
An operation in the stack-based virtual machine.
Variants
Not operator. Takes a boolean from the top of the stack and inverts its logical value.
Operation
<bool>
=> <bool>
Add two things together.
This is the result of an <a> + <b>
expression.
Add a value to the given frame offset.
This is the result of an <offset> += <b>
expression.
Fields of AddAssign
offset: usize
The frame offset to assign to.
Subtract two things.
This is the result of an <a> - <b>
expression.
Subtract a value to the given frame offset.
This is the result of an <offset> -= <b>
expression.
Fields of SubAssign
offset: usize
The frame offset to assign to.
Multiply two things.
This is the result of an <a> * <b>
expression.
Multiply a value to the given frame offset.
This is the result of an <offset> *= <b>
expression.
Fields of MulAssign
offset: usize
The frame offset to assign to.
Divide two things.
This is the result of an <a> / <b>
expression.
Divide a value to the given frame offset.
This is the result of an <offset> /= <b>
expression.
Fields of DivAssign
offset: usize
The frame offset to assign to.
Remainder operation.
This is the result of an <a> % <b>
expression.
Operation
<value>
<value>
=> <value>
Fields of Fn
hash: Hash
The hash to construct a function pointer from.
Construct a closure that takes the given number of arguments and
captures count
elements from the top of the stack.
Operation
<value..>
=> <fn>
Fields of Closure
Perform a function call.
It will construct a new stack frame which includes the last args
number of entries.
Fields of Call
Perform a instance function call.
The instance being called on should be on top of the stack, followed by
args
number of arguments.
Fields of CallInstance
Lookup the specified instance function and put it on the stack. This might help in cases where a single instance function is called many times (like in a loop) since it avoids calculating its full hash on every iteration.
Note that this does not resolve that the instance function exists, only that the instance does.
Operation
<value>
=> <fn>
Fields of LoadInstanceFn
hash: Hash
The name hash of the instance function.
Perform a function call on a function pointer stored on the stack.
Operation
<fn>
<args...>
=> <ret>
Fields of CallFn
args: usize
The number of arguments expected on the stack for this call.
Perform an index get operation. Pushing the result on the stack.
Operation
<target>
<index>
=> <value>
Get the given index out of a tuple on the top of the stack. Errors if the item doesn't exist or the item is not a tuple.
Operation
<tuple>
=> <value>
Fields of TupleIndexGet
index: usize
The index to fetch.
Set the given index of the tuple on the stack, with the given value.
Operation
<value>
<tuple>
=> *nothing*
Fields of TupleIndexSet
index: usize
The index to set.
Get the given index out of a tuple from the given variable slot. Errors if the item doesn't exist or the item is not a tuple.
Operation
=> <value>
Fields of TupleIndexGetAt
Get the given index out of an object on the top of the stack. Errors if the item doesn't exist or the item is not an object.
The index is identifier by a static string slot, which is provided as an argument.
Operation
<object>
=> <value>
Fields of ObjectSlotIndexGet
slot: usize
The static string slot corresponding to the index to fetch.
Get the given index out of an object from the given variable slot. Errors if the item doesn't exist or the item is not an object.
The index is identifier by a static string slot, which is provided as an argument.
Operation
=> <value>
Fields of ObjectSlotIndexGetAt
Push a literal integer.
Fields of Integer
number: i64
The number to push.
Push a literal float into a slot.
Fields of Float
number: f64
The number to push.
Await the future that is on the stack and push the value that it produces.
Operation
<future>
=> <value>
Select over len
futures on the stack. Sets the branch
register to
the index of the branch that completed. And pushes its value on the
stack.
This operation will block the VM until at least one of the underlying futures complete.
Operation
<future...>
=> <value>
Fields of Select
len: usize
The number of futures to poll.
Fields of PopN
count: usize
The number of elements to pop from the stack.
If the stop of the stack is true, will pop the given count
entries on
the stack and jump to the given offset.
Operation
<bool>
=> *noop*
Fields of PopAndJumpIf
If the stop of the stack is false, will pop the given count
entries on
the stack and jump to the given offset.
Operation
<bool>
=> *noop*
Fields of PopAndJumpIfNot
Clean the stack by keeping the top of it, and popping count
values
under it.
Operation
<top>
<value..>
=> <top>
Fields of Clean
count: usize
The number of entries in the stack to pop.
Copy a variable from a location offset
relative to the current call
frame.
A copy is very cheap. It simply means pushing a reference to the stack.
Fields of Copy
offset: usize
Offset to copy value from.
Fields of Drop
offset: usize
Frame offset to drop.
Replace a value at the offset relative from the top of the stack, with the top of the stack.
Fields of Replace
offset: usize
Offset to swap value from.
Pop the current stack frame and restore the instruction pointer from it.
The stack frame will be cleared, and the value on the top of the stack will be left on top of it.
Pop the current stack frame and restore the instruction pointer from it.
The stack frame will be cleared, and a unit value will be pushed to the top of the stack.
Compare two values on the stack for lt and push the result as a boolean on the stack.
Compare two values on the stack for gt and push the result as a boolean on the stack.
Compare two values on the stack for lte and push the result as a boolean on the stack.
Compare two values on the stack for gte and push the result as a boolean on the stack.
Compare two values on the stack for equality and push the result as a boolean on the stack.
Operation
<b>
<a>
=> <bool>
Compare two values on the stack for inequality and push the result as a boolean on the stack.
Operation
<b>
<a>
=> <bool>
Unconditionally jump to offset
relative to the current instruction
pointer.
Operation
*nothing*
=> *nothing*
Fields of Jump
offset: isize
Offset to jump to.
Jump to offset
relative to the current instruction pointer if the
condition is true
.
Operation
<boolean>
=> *nothing*
Fields of JumpIf
offset: isize
Offset to jump to.
Jump to offset
relative to the current instruction pointer if the
condition is false
.
Operation
<boolean>
=> *nothing*
Fields of JumpIfNot
offset: isize
Offset to jump to.
Compares the branch
register with the top of the stack, and if they
match pops the top of the stack and performs the jump to offset.
Operation
<integer>
=> *nothing*
Fields of JumpIfBranch
Fields of Bool
value: bool
The boolean value to push.
Construct a push a vector value onto the stack. The number of elements
in the vector are determined by count
and are popped from the stack.
Operation
<value..>
=> <vec>
Fields of Vec
count: usize
The size of the vector.
Construct a push a tuple value onto the stack. The number of elements
in the tuple are determined by count
and are popped from the stack.
Operation
<value..>
=> <tuple>
Fields of Tuple
count: usize
The size of the tuple.
Construct a push an object onto the stack. The number of elements
in the object are determined the slot of the object keys slot
and are
popped from the stack.
For each element, a value is popped corresponding to the object key.
Operation
<value..>
=> <object>
Fields of Object
slot: usize
The static slot of the object keys.
Construct a push an object of the given type onto the stack. The number
of elements in the object are determined the slot of the object keys
slot
and are popped from the stack.
For each element, a value is popped corresponding to the object key.
Operation
<value..>
=> <object>
Fields of TypedObject
Construct a push an object of the given type onto the stack. The number
of elements in the object are determined the slot of the object keys
slot
and are popped from the stack.
For each element, a value is popped corresponding to the object key.
Operation
<value..>
=> <object>
Fields of VariantObject
Fields of Char
c: char
The literal character to load.
Fields of Byte
b: u8
The literal byte to load.
Fields of String
slot: usize
The static string slot to load the string from.
Fields of Bytes
slot: usize
The static byte string slot to load the string from.
Pop the given number of values from the stack, and concatenate a string from them.
This is a dedicated template-string optimization.
Operation
<value...>
=> <string>
Fields of StringConcat
Test if the top of the stack is an instance of the second item on the stack.
Operation
<type>
<value>
=> <boolean>
Test if the top of the stack is not an instance of the second item on the stack.
Operation
<type>
<value>
=> <boolean>
Pop two values from the stack and test if they are both boolean true.
Operation
<boolean>
<boolean>
=> <boolean>
Pop two values from the stack and test if either of them are boolean true.
Operation
<boolean>
<boolean>
=> <boolean>
Test if the top of the stack is a value.
This expects the top of the stack to be an option
or a result
,
and it is a value if these are either Some
or Ok
.
Operation
<value>
=> <boolean>
Unwrap a result from the top of the stack. This causes a vm error if the top of the stack is not an ok result.
Operation
<result>
=> <value>
Fields of EqByte
byte: u8
The byte to test against.
Fields of EqCharacter
character: char
The character to test against.
Fields of EqInteger
integer: i64
The integer to test against.
Fields of EqStaticString
slot: usize
The slot to test against.
Test that the top of the stack is a tuple with the given length requirements.
Operation
<value>
=> <boolean>
Fields of MatchSequence
Test that the top of the stack is an object matching the given slot of object keys.
Operation
<object>
=> <boolean>
Fields of MatchObject
Fields of Type
hash: Hash
The hash of the type.
Perform a generator yield where the value yielded is expected to be found at the top of the stack.
This causes the virtual machine to suspend itself.
Operation
<value>
=> <value>
Perform a generator yield with a unit.
This causes the virtual machine to suspend itself.
Operation
=> <unit>
Cause the VM to panic and error out without a reason.
This should only be used during testing or extreme scenarios that are completely unrecoverable.
Fields of Panic
reason: PanicReason
The reason for the panic.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Inst
impl Send for Inst
impl Sync for Inst
impl Unpin for Inst
impl UnwindSafe for Inst
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,
fn borrow_mut(&mut self) -> &mut T
[src]
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,