Struct aluvm::vm::Vm [−][src]
pub struct Vm<Isa = Instr<ReservedOp>> where
Isa: InstructionSet, { /* fields omitted */ }
Expand description
Alu virtual machine providing single-core execution environment
Implementations
Method borrowing Vm::libs
field.
Libraries known to the runtime, identified by their hashes
Method borrowing Vm::entrypoint
field.
Entrypoint for the main function
Method borrowing Vm::registers
field.
A set of registers
Method borrowing Vm::phantom
field.
Constructs new virtual machine with no code in it.
Calling Vm::main
on it will result in machine termination with st0
set to false
.
Adds Alu bytecode library to the virtual machine.
Errors
Checks requirement that the total number of libraries must not exceed LIBS_MAX_TOTAL
and
returns Error::TooManyLibs
otherwise.
Checks that the ISA used by the VM supports ISA extensions specified by the library and
returns Error::IsaNotSupported
otherwise.
Returns
true
if the library was already known and false
otherwise.
Sets new entry point value (used when calling Vm::main
)
Executes the program starting from the provided entry point (set with Vm::set_entrypoint
or initialized to 0 offset of the first used library if Vm::new
, Vm::default
or
Vm::with
were used).
Returns
Value of the st0
register at the end of the program execution.