(
func: &Function,
store: &mut Store,
params: &[WasmValue],
)
| 54 | ) -> Result<FuncExecution<'store>> { |
| 55 | #[inline] |
| 56 | fn call_resumable_inner( |
| 57 | func: &Function, |
| 58 | store: &mut Store, |
| 59 | params: &[WasmValue], |
| 60 | ) -> Result<FuncExecutionState> { |
| 61 | let func_instance = store.state.get_func(func.addr); |
| 62 | match func_instance { |
| 63 | FunctionInstance::Host(host_func) => host_func |
| 64 | .clone() |
| 65 | .call(FuncContext { store, module_addr: func.module_addr }, params) |
| 66 | .map(|result| FuncExecutionState::Completed { result: Some(result) }), |
| 67 | FunctionInstance::Wasm(wasm_func) => { |
| 68 | store.call_stack.clear(); |
| 69 | store.value_stack.clear(); |
| 70 | store.value_stack.extend_from_wasmvalues(params)?; |
| 71 | let locals_base = store.value_stack.enter_locals(&wasm_func.func.params, &wasm_func.func.locals)?; |
| 72 | let callframe = CallFrame::new(func.addr, locals_base, wasm_func.func.locals); |
| 73 | |
| 74 | Ok(FuncExecutionState::Running { |
| 75 | exec_state: ExecutionState { callframe }, |
| 76 | root_func_addr: func.addr, |
| 77 | }) |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | self.item.validate_store(store)?; |
| 83 | validate_call_params(&self.ty, params)?; |
nothing calls this directly
no test coverage detected