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

Method trampoline_func_ref

crates/wasmtime/src/runtime/vm/component.rs:485–496  ·  view source on GitHub ↗

Returns the core wasm `funcref` corresponding to the trampoline specified. The returned function is suitable to pass directly to a wasm module instantiation and the function contains cranelift-compiled trampolines. This can only be called after `idx` has been initialized at runtime during the instantiation process of a component.

(&self, idx: TrampolineIndex)

Source from the content-addressed store, hash-verified

483 /// This can only be called after `idx` has been initialized at runtime
484 /// during the instantiation process of a component.
485 pub fn trampoline_func_ref(&self, idx: TrampolineIndex) -> NonNull<VMFuncRef> {
486 unsafe {
487 let offset = self.offsets.trampoline_func_ref(idx);
488 let ret = self.vmctx_plus_offset_raw::<VMFuncRef>(offset);
489 debug_assert!(
490 mem::transmute::<Option<VmPtr<VMWasmCallFunction>>, usize>(ret.as_ref().wasm_call)
491 != INVALID_PTR
492 );
493 debug_assert!(ret.as_ref().vmctx.as_ptr() as usize != INVALID_PTR);
494 ret
495 }
496 }
497
498 /// Get the core Wasm function reference for the given unsafe intrinsic.
499 pub fn unsafe_intrinsic_func_ref(&self, idx: UnsafeIntrinsic) -> NonNull<VMFuncRef> {

Callers 3

lookup_vmdefFunction · 0.45
set_trampolineMethod · 0.45
initialize_vmctxMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected