MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / exec_return_call

Method exec_return_call

crates/tinywasm/src/interpreter/executor.rs:954–971  ·  view source on GitHub ↗
(&mut self, wasm_func: WasmFunctionInstance, func_addr: FuncAddr)

Source from the content-addressed store, hash-verified

952 }
953
954 fn exec_return_call(&mut self, wasm_func: WasmFunctionInstance, func_addr: FuncAddr) -> Result<(), Trap> {
955 if !Arc::ptr_eq(&self.func, &wasm_func.func) {
956 self.func = wasm_func.func.clone();
957 }
958
959 self.store.value_stack.truncate_keep_counts(self.cf.locals_base, wasm_func.func.params);
960 let Ok(locals_base) = self.store.value_stack.enter_locals(&wasm_func.func.params, &wasm_func.func.locals)
961 else {
962 cold_path();
963 return Err(Trap::CallStackOverflow);
964 };
965 self.cf = CallFrame::new(func_addr, locals_base, wasm_func.func.locals);
966 if wasm_func.owner != self.module.idx() {
967 self.module = self.store.get_module_instance_internal(wasm_func.owner);
968 }
969
970 Ok(())
971 }
972
973 fn exec_call_host(&mut self, host_func: Rc<HostFunction>) -> Result<(), Trap> {
974 let mut params = self.store.value_stack.pop_types(host_func.ty.params().iter().rev()).collect::<Vec<_>>();

Callers 2

exec_call_indirectMethod · 0.80

Calls 4

truncate_keep_countsMethod · 0.80
enter_localsMethod · 0.80
idxMethod · 0.80

Tested by

no test coverage detected