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

Method get_trampoline

cranelift/filetests/src/function_runner.rs:379–392  ·  view source on GitHub ↗

Return a trampoline for calling. Returns None if [TestFileCompiler::create_trampoline_for_function] wasn't called for this function.

(&self, func: &Function)

Source from the content-addressed store, hash-verified

377 ///
378 /// Returns None if [TestFileCompiler::create_trampoline_for_function] wasn't called for this function.
379 pub fn get_trampoline(&self, func: &Function) -> Option<Trampoline<'_>> {
380 let defined_func = self.defined_functions.get(&func.name)?;
381 let trampoline_id = self
382 .trampolines
383 .get(&func.signature)
384 .and_then(|name| self.defined_functions.get(name))
385 .map(|df| df.func_id)?;
386 Some(Trampoline {
387 module: self.module.as_ref()?,
388 func_id: defined_func.func_id,
389 func_signature: &defined_func.signature,
390 trampoline_id,
391 })
392 }
393}
394
395impl Drop for CompiledTestFile {

Callers 3

run_testFunction · 0.80
nopFunction · 0.80
run_file_contentsFunction · 0.80

Calls 3

getMethod · 0.45
mapMethod · 0.45
as_refMethod · 0.45

Tested by 2

run_testFunction · 0.64
nopFunction · 0.64