MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / call

Method call

cranelift/interpreter/src/interpreter.rs:71–89  ·  view source on GitHub ↗

Interpret a call to a [Function] given its [DataValue] arguments.

(
        &mut self,
        function: &'a Function,
        arguments: &[DataValue],
    )

Source from the content-addressed store, hash-verified

69
70 /// Interpret a call to a [Function] given its [DataValue] arguments.
71 fn call(
72 &mut self,
73 function: &'a Function,
74 arguments: &[DataValue],
75 ) -> Result<ControlFlow<'a>, InterpreterError> {
76 trace!("Call: {}({:?})", function.name, arguments);
77 let first_block = function
78 .layout
79 .blocks()
80 .next()
81 .expect("to have a first block");
82 let parameters = function.dfg.block_params(first_block);
83 self.state.push_frame(function);
84 self.state
85 .current_frame_mut()
86 .set_all(parameters, arguments.to_vec());
87
88 self.block(first_block)
89 }
90
91 /// Interpret a [Block] in a [Function]. This drives the interpretation over sequences of
92 /// instructions, which may continue in other blocks, until the function returns.

Callers 2

call_by_indexMethod · 0.45
blockMethod · 0.45

Calls 9

blocksMethod · 0.80
set_allMethod · 0.80
current_frame_mutMethod · 0.80
expectMethod · 0.45
nextMethod · 0.45
block_paramsMethod · 0.45
push_frameMethod · 0.45
to_vecMethod · 0.45
blockMethod · 0.45

Tested by

no test coverage detected