use crate::extern_::{Memory, Table};
use crate::func::Func;
use crate::instance::Instance;
use crate::module::code::Code;
use crate::value::Ref;
pub(crate) enum Outcome {
Finished,
#[cfg(feature = "async")]
HostAsync {
func: Func,
instance: Instance,
},
#[cfg(feature = "async")]
FuelYield,
EpochDeadline,
Grow {
memory: Memory,
delta: u64,
},
TableGrow {
table: Table,
delta: u64,
init: Ref,
},
GcGrow {
reserved_target: usize,
bytes_needed: u64,
},
}
pub(super) enum StepOutcome {
Advance(u32),
DoCall(CallReq),
DoTailCall(CallReq),
DoTailHostCall {
func: Func,
instance: Instance,
n_params: u32,
},
DoHostCall {
func: Func,
instance: Instance,
return_ip: u32,
},
#[cfg(feature = "async")]
DoTailHostAsyncCall {
func: Func,
instance: Instance,
n_params: u32,
},
#[cfg(feature = "async")]
DoHostAsyncCall {
func: Func,
instance: Instance,
return_ip: u32,
},
DoGrow {
memory: Memory,
delta: u64,
return_ip: u32,
},
DoTableGrow {
table: Table,
delta: u64,
init: Ref,
return_ip: u32,
},
DoGcGrow {
reserved_target: usize,
bytes_needed: u64,
return_ip: u32,
},
}
pub(super) enum ResolvedCall {
Wasm(Instance, u32, Code),
Host(Func),
#[cfg(feature = "async")]
HostAsync(Func),
}
pub(super) struct CallReq {
pub return_ip: u32,
pub instance: Instance,
pub func_index: u32,
pub code: Code,
}