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

Method exec_call

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

Source from the content-addressed store, hash-verified

932 }
933
934 fn exec_call(&mut self, wasm_func: WasmFunctionInstance, func_addr: FuncAddr) -> Result<(), Trap> {
935 if !Arc::ptr_eq(&self.func, &wasm_func.func) {
936 self.func = wasm_func.func.clone();
937 }
938
939 let Ok(locals_base) = self.store.value_stack.enter_locals(&wasm_func.func.params, &wasm_func.func.locals)
940 else {
941 cold_path();
942 return Err(Trap::CallStackOverflow);
943 };
944
945 self.store.call_stack.push(self.cf)?;
946 self.cf = CallFrame::new(func_addr, locals_base, wasm_func.func.locals);
947 if wasm_func.owner != self.module.idx() {
948 self.module = self.store.get_module_instance_internal(wasm_func.owner);
949 }
950
951 Ok(())
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) {

Callers 2

exec_call_directMethod · 0.80
exec_call_indirectMethod · 0.80

Calls 4

enter_localsMethod · 0.80
idxMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected