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

Method call

cranelift/filetests/src/function_runner.rs:420–434  ·  view source on GitHub ↗

Call the target function of this trampoline, passing in [DataValue]s using a compiled trampoline.

(&self, compiled: &CompiledTestFile, arguments: &[DataValue])

Source from the content-addressed store, hash-verified

418impl<'a> Trampoline<'a> {
419 /// Call the target function of this trampoline, passing in [DataValue]s using a compiled trampoline.
420 pub fn call(&self, compiled: &CompiledTestFile, arguments: &[DataValue]) -> Vec<DataValue> {
421 let mut values = UnboxedValues::make_arguments(arguments, &self.func_signature);
422 let arguments_address = values.as_mut_ptr();
423
424 let function_ptr = self.module.get_finalized_function(self.func_id);
425 let trampoline_ptr = self.module.get_finalized_function(self.trampoline_id);
426
427 COMPILED_TEST_FILE.set(compiled as *const _);
428 unsafe {
429 self.call_raw(trampoline_ptr, function_ptr, arguments_address);
430 }
431 COMPILED_TEST_FILE.set(std::ptr::null());
432
433 values.collect_returns(&self.func_signature)
434 }
435
436 unsafe fn call_raw(
437 &self,

Callers 15

run_testFunction · 0.45
call_rawMethod · 0.45
nopFunction · 0.45
call_memcpyMethod · 0.45
call_memsetMethod · 0.45
call_memmoveMethod · 0.45
call_memcmpMethod · 0.45
needs_stack_map_and_loopFunction · 0.45
needs_stack_map_simpleFunction · 0.45

Calls 5

collect_returnsMethod · 0.80
as_mut_ptrMethod · 0.45
setMethod · 0.45
call_rawMethod · 0.45