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)
| 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> { |
no outgoing calls
no test coverage detected