pub fn call_direct_imported(
        &mut self,
        index: u32,
        arg_types: impl IntoIterator<Item = SignlessType>,
        return_types: impl IntoIterator<Item = SignlessType>,
    ) {
        let locs = arg_locs(arg_types);

        dynasm!(self.asm
            ; push Rq(VMCTX)
        );
        self.block_state.depth.reserve(1);
        let depth = self.block_state.depth.clone();

        self.save_volatile(..locs.len());
        self.pass_outgoing_args(&locs);

        let callee = self.take_reg(I64).unwrap();

        dynasm!(self.asm
            ; mov Rq(callee.rq().unwrap()), [
                Rq(VMCTX) + self.module_context.vmctx_vmfunction_import_body(index) as i32
            ]
            ; mov Rq(VMCTX), [
                Rq(VMCTX) + self.module_context.vmctx_vmfunction_import_vmctx(index) as i32
            ]
            ; call Rq(callee.rq().unwrap())
        );

        self.block_state.regs.release(callee);

        for i in locs {
            self.free_value(i.into());
        }

        self.push_function_returns(return_types);

        self.set_stack_depth(depth);
        dynasm!(self.asm
            ; pop Rq(VMCTX)
        );
        self.block_state.depth.free(1);
    }
/// Call a function with the given index
Call a function with the given index
Call a function with the given index
pub fn call_direct_imported(
        &mut self,
        index: u32,
        arg_types: impl IntoIterator<Item = SignlessType>,
        return_types: impl IntoIterator<Item = SignlessType>,
    ) {
        let locs = arg_locs(arg_types);
        dynasm!(self.asm
            ; push Rq(VMCTX)
        );
        self.block_state.depth.reserve(1);
        let depth = self.block_state.depth.clone();
        self.save_volatile(..locs.len());
        self.pass_outgoing_args(&locs);
        let callee = self.take_reg(I64).unwrap();
        dynasm!(self.asm
            ; mov Rq(callee.rq().unwrap()), [
                Rq(VMCTX) + self.module_context.vmctx_vmfunction_import_body(index) as i32
            ]
            ; mov Rq(VMCTX), [
                Rq(VMCTX) + self.module_context.vmctx_vmfunction_import_vmctx(index) as i32
            ]
            ; call Rq(callee.rq().unwrap())
        );
        self.block_state.regs.release(callee);
        for i in locs {
            self.free_value(i.into());
        }
        self.push_function_returns(return_types);
        self.set_stack_depth(depth);
        dynasm!(self.asm
            ; pop Rq(VMCTX)
        );
        self.block_state.depth.free(1);
    }
pub fn call_direct_imported ( & mut self , index : u32 , arg_types : impl IntoIterator < Item = SignlessType > , return_types : impl IntoIterator < Item = SignlessType > , ) { let locs = arg_locs ( arg_types ) ; dynasm ! ( self asm push Rq ( VMCTX ) ) ; self . block_state . depth . reserve ( 1 ) ; let depth = self . block_state . depth . clone ( ) ; self . save_volatile ( .. locs . len ( ) ) ; self . pass_outgoing_args ( & locs ) ; let callee = self . take_reg ( I64 ) . unwrap ( ) ; dynasm ! ( self asm mov Rq ( callee rq ( ) unwrap ( ) ) [ Rq ( VMCTX ) self module_context vmctx_vmfunction_import_body ( index ) as i32 ] mov Rq ( VMCTX ) [ Rq ( VMCTX ) self module_context vmctx_vmfunction_import_vmctx ( index ) as i32 ] call Rq ( callee rq ( ) unwrap ( ) ) ) ; self . block_state . regs . release ( callee ) ; for i in locs { self . free_value ( i . into ( ) ) ; } self . push_function_returns ( return_types ) ; self . set_stack_depth ( depth ) ; dynasm ! ( self asm pop Rq ( VMCTX ) ) ; self . block_state . depth . free ( 1 ) ; }
Call a function with the given index
Call a function with the given index
&mut self
index
u32
arg_types
impl IntoIterator<Item = SignlessType>
return_types
impl IntoIterator<Item = SignlessType>