pub enum Op {
Return,
Label(Label),
LoadModule {
module: BitcodeModule,
dest: OpDestination,
},
Declare {
name: Symbol,
mutable: bool,
access: Access,
value: ValueOrSource,
dest: OpDestination,
},
Unary {
op: ValueOrSource,
dest: OpDestination,
kind: UnaryKind,
},
BinOp {
op1: ValueOrSource,
op2: ValueOrSource,
dest: OpDestination,
kind: BinaryKind,
},
Call {
name: ValueOrSource,
arity: ValueOrSource,
},
Invoke {
target: ValueOrSource,
name: Symbol,
arity: ValueOrSource,
},
Throw(FaultKind),
}Expand description
A virtual machine operation.
Variants§
Return
Return from the current function.
Label(Label)
Assign this label to the next instruction.
LoadModule
Load module, storing a reference into dest.
Fields
module: BitcodeModuleThe module to load.
dest: OpDestinationThe location to store the loaded module.
Declare
Declare name with value, storing a copy of the value in dest.
Fields
value: ValueOrSourceThe initial value of the declaration.
dest: OpDestinationThe destination to store a copy of value.
Unary
An operation with one argument that stores its result in dest.
Fields
op: ValueOrSourceThe value to operate on.
dest: OpDestinationThe destination for the result.
BinOp
An operation with two arguments that stores its result in dest.
Fields
op1: ValueOrSourceThe first value to operate on.
op2: ValueOrSourceThe second value to operate on.
dest: OpDestinationThe destination for the result.
kind: BinaryKindThe operation kind.
Call
Invoke name as a function with arity number of arguments provided.
Fields
name: ValueOrSourceThe name of the function.
arity: ValueOrSourceThe number of arguments provided to this invocation.
Invoke
Invoke name on target with arity number of arguments provided.
Fields
target: ValueOrSourceThe target to invoke the function on.
arity: ValueOrSourceThe number of arguments provided to this invocation.
Throw(FaultKind)
Throw an exception.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Op
impl<'de> Deserialize<'de> for Op
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnwindSafe for Op
Blanket Implementations§
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
§impl<A> Cast for A
impl<A> Cast for A
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)