Struct bytecode_interpreter::concrete::runtime::Runtime
source · pub struct Runtime<'env> { /* private fields */ }
Expand description
A stackless bytecode runtime in charge of pre- and post-execution checking, conversion, and
monitoring. The main, step-by-step interpretation loop is delegated to the Player
instance.
Implementations§
source§impl<'env> Runtime<'env>
impl<'env> Runtime<'env>
sourcepub fn new(env: &'env GlobalEnv, functions: &'env FunctionTargetsHolder) -> Self
pub fn new(env: &'env GlobalEnv, functions: &'env FunctionTargetsHolder) -> Self
Construct a runtime with all information pre-loaded.
sourcepub fn execute(
&self,
fun_env: &FunctionEnv<'_>,
ty_args: &[TypeTag],
args: &[MoveValue],
global_state: &mut GlobalState
) -> VMResult<Vec<TypedValue>>
pub fn execute( &self, fun_env: &FunctionEnv<'_>, ty_args: &[TypeTag], args: &[MoveValue], global_state: &mut GlobalState ) -> VMResult<Vec<TypedValue>>
Execute a function (identified by fun_id
) with given type arguments, arguments, and a
mutable reference of the global state. Returns the result of the execution. Any updates to
the global states is recorded in the mutable reference.