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

Function wasm_sig

winch/codegen/src/abi/mod.rs:78–85  ·  view source on GitHub ↗

Constructs an [ABISig] using Winch's ABI.

(ty: &WasmFuncType)

Source from the content-addressed store, hash-verified

76
77/// Constructs an [ABISig] using Winch's ABI.
78pub(crate) fn wasm_sig<A: ABI>(ty: &WasmFuncType) -> Result<ABISig> {
79 // 6 is used semi-arbitrarily here, we can modify as we see fit.
80 let mut params: SmallVec<[WasmValType; 6]> = SmallVec::new();
81 params.extend_from_slice(&vmctx_types::<A>());
82 params.extend_from_slice(ty.params());
83
84 A::sig_from(&params, ty.results(), &CallingConvention::Default)
85}
86
87/// Returns the callee and caller [VMContext] types.
88pub(crate) fn vmctx_types<A: ABI>() -> [WasmValType; 2] {

Callers

nothing calls this directly

Calls 3

newFunction · 0.50
paramsMethod · 0.45
resultsMethod · 0.45

Tested by

no test coverage detected