pulley_interpreter::decode

Trait ExtendedOpVisitor

Source
pub trait ExtendedOpVisitor: OpVisitor {
    // Required methods
    fn trap(&mut self) -> Self::Return;
    fn nop(&mut self) -> Self::Return;
    fn call_indirect_host(&mut self, sig: u8) -> Self::Return;
}
Available on crate feature decode only.
Expand description

Like OpVisitor but for extended operations.

Required Methods§

Source

fn trap(&mut self) -> Self::Return

Raise a trap.

Source

fn nop(&mut self) -> Self::Return

Do nothing.

Source

fn call_indirect_host(&mut self, sig: u8) -> Self::Return

A special opcode to use an indirect function call to reenter the host from the interpreter.

This is used to implement host intrinsics such as memory.grow for example where that needs to reenter the host from the interpreter.

The sig immediate here is the Nth signature in the for_each_host_signature! macro below. The 0th “argument”, in register x0, is the function pointer that’s being called and all further arguments follow after that in registers.

Implementors§

Source§

impl ExtendedOpVisitor for Disassembler<'_>

Available on crate feature disas only.
Source§

impl<B: BytecodeStream> ExtendedOpVisitor for MaterializeOpsVisitor<B>

Source§

impl<F, T, V1, V2> ExtendedOpVisitor for SequencedVisitor<'_, F, V1, V2>
where F: FnMut(V1::Return, V2::Return) -> T, V1: ExtendedOpVisitor, V2: ExtendedOpVisitor<BytecodeStream = V1::BytecodeStream>,