Enum bones_framework::prelude::piccolo::opcode::Operation
pub enum Operation {
Show 45 variants
Move {
dest: RegisterIndex,
source: RegisterIndex,
},
LoadConstant {
dest: RegisterIndex,
constant: ConstantIndex16,
},
LoadBool {
dest: RegisterIndex,
value: bool,
skip_next: bool,
},
LoadNil {
dest: RegisterIndex,
count: u8,
},
NewTable {
dest: RegisterIndex,
array_size: u8,
map_size: u8,
},
GetTable {
dest: RegisterIndex,
table: RegisterIndex,
key: RCIndex,
},
SetTable {
table: RegisterIndex,
key: RCIndex,
value: RCIndex,
},
GetUpTable {
dest: RegisterIndex,
table: UpValueIndex,
key: RCIndex,
},
SetUpTable {
table: UpValueIndex,
key: RCIndex,
value: RCIndex,
},
SetList {
base: RegisterIndex,
count: VarCount,
},
Call {
func: RegisterIndex,
args: VarCount,
returns: VarCount,
},
TailCall {
func: RegisterIndex,
args: VarCount,
},
Return {
start: RegisterIndex,
count: VarCount,
},
VarArgs {
dest: RegisterIndex,
count: VarCount,
},
Jump {
offset: i16,
close_upvalues: Opt254,
},
Test {
value: RegisterIndex,
is_true: bool,
},
TestSet {
dest: RegisterIndex,
value: RegisterIndex,
is_true: bool,
},
Closure {
dest: RegisterIndex,
proto: PrototypeIndex,
},
NumericForPrep {
base: RegisterIndex,
jump: i16,
},
NumericForLoop {
base: RegisterIndex,
jump: i16,
},
GenericForCall {
base: RegisterIndex,
var_count: u8,
},
GenericForLoop {
base: RegisterIndex,
jump: i16,
},
Method {
base: RegisterIndex,
table: RegisterIndex,
key: RCIndex,
},
Concat {
dest: RegisterIndex,
source: RegisterIndex,
count: u8,
},
GetUpValue {
dest: RegisterIndex,
source: UpValueIndex,
},
SetUpValue {
dest: UpValueIndex,
source: RegisterIndex,
},
Length {
dest: RegisterIndex,
source: RegisterIndex,
},
Eq {
skip_if: bool,
left: RCIndex,
right: RCIndex,
},
Less {
skip_if: bool,
left: RCIndex,
right: RCIndex,
},
LessEq {
skip_if: bool,
left: RCIndex,
right: RCIndex,
},
Not {
dest: RegisterIndex,
source: RegisterIndex,
},
Minus {
dest: RegisterIndex,
source: RegisterIndex,
},
Add {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
Sub {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
Mul {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
Div {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
IDiv {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
Mod {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
Pow {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
BitAnd {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
BitOr {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
BitXor {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
ShiftLeft {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
ShiftRight {
dest: RegisterIndex,
left: RCIndex,
right: RCIndex,
},
BitNot {
dest: RegisterIndex,
source: RegisterIndex,
},
}
Variants§
Move
LoadConstant
LoadBool
LoadNil
NewTable
GetTable
SetTable
GetUpTable
SetUpTable
SetList
Set elements of a table as a list.
Expects the table to be at the base
index, and it expects a register for the last set
table index at base + 1
. The register at base + 1
must always be an integer.
On execution, it will set N values in the table at base + 1 + n
, offset all of the indexes
by the base + 1
startind index, and increment the starting index by however many values
were set.
Call
Call the given function with arguments placed after it, invalidates the function register and all registers above it. When the function returns, the results are placed starting where the function was located.
TailCall
Effectively, call the given function with the arguments placed after it, and return the results of this function to the upper frame. Invalidates the entire current frame and replaces it with the called function.
Return
VarArgs
Places the contents of the “varargs” at the given register, expecting the given count. If the count is “variable”, then the top of the stack indicates the number of available arguments.
Jump
Test
Test the register as a boolean, if its boolean value matches is_true
, skip the next
instruction.
TestSet
Test the value at the value
register as a boolean, if its boolean value matches is_true
,
skip the next instruction, otherwise assign the given value (not converted to a boolean) to
the destination register.
Closure
NumericForPrep
Used to set up for a numeric for loop:
R(base) -= R(base + 2) pc += jump
NumericForLoop
Used to iterate a numeric for loop:
R(base) += R(base + 2) if R(base) <?= R(base + 1) then pc += jump R(base + 3) = R(base) end
The <?=
operator here means “less than” if the step (aka R(base + 2)) is positive, and
“greater than” if the step is negative
GenericForCall
Used to set up for a generic for loop:
R(base + 3), …, R(base + 2 + var_count) = R(base)(R(base + 1), R(base + 2))
GenericForLoop
Used to iterate a generic for loop:
if R(base + 1) ~= nil then R(base) = R(base + 1) pc += jump end
Method
Used for calling methods on tables: R(base + 1) = R(table) R(base) = R(table)[RC(key)]
Concat
Concatenate the given arguments into a string
GetUpValue
SetUpValue
Length
Eq
Less
LessEq
Not
Minus
Add
Sub
Mul
Div
IDiv
Mod
Pow
BitAnd
BitOr
BitXor
ShiftLeft
ShiftRight
BitNot
Trait Implementations§
§impl Collect for Operationwhere
Operation: 'static,
impl Collect for Operationwhere
Operation: 'static,
§fn needs_trace() -> bool
fn needs_trace() -> bool
Gc
pointer and trace
is unnecessary
to call, you may implement this method and return false. The default implementation returns
true, signaling that Collect::trace
must be called.impl Copy for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.