pub struct CallIndirectHost {
pub id: u8,
}
Expand description
A special opcode to halt interpreter execution and yield control back to the host.
This opcode results in DoneReason::CallIndirectHost
where the
id
here is shepherded along to the embedder. It’s up to the
embedder to determine what to do with the id
and the current
state of registers and the stack.
In Wasmtime this is used to implement interpreter-to-host calls.
This is modeled as a call
instruction where the first
parameter is the native function pointer to invoke and all
remaining parameters for the native function are in following
parameter positions (e.g. x1
, x2
, …). The results of the
host call are then store in x0
.
Handling this in Wasmtime is done through a “relocation” which is resolved at link-time when raw bytecode from Cranelift is assembled into the final object that Wasmtime will interpret.
Fields§
§id: u8
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for CallIndirectHost
impl<'arbitrary> Arbitrary<'arbitrary> for CallIndirectHost
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl Clone for CallIndirectHost
impl Clone for CallIndirectHost
Source§fn clone(&self) -> CallIndirectHost
fn clone(&self) -> CallIndirectHost
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CallIndirectHost
impl Debug for CallIndirectHost
Source§impl Encode for CallIndirectHost
Available on crate feature encode
only.
impl Encode for CallIndirectHost
encode
only.