PR #5288 implements the function references proposal modulo a few missing bits. The missing bits are:
[x] Support for function references in the embedder API.
[x] Failing tests:
[x] type-equivalence.wast: type canonicalisation is currently broken due to #[derive(hash)] not considering that two distinct typed function reference indices may point to structurally equivalent types.
[x] br_table.wast: this fails due to incomplete support for the various syntactic sugar in the wasm-tools/wast crate. See bytecodealliance/wasm-tools/pull/952.
[x] ref_null.wast and local_init.wast: fail due to lack of support in the embedder API.
[x] return_call_ref.wast, return_call_indirect.wast, and return_call.wast: fail due to lack of tail call support.
PR #5288 implements the function references proposal modulo a few missing bits. The missing bits are:
type-equivalence.wast
: type canonicalisation is currently broken due to#[derive(hash)]
not considering that two distinct typed function reference indices may point to structurally equivalent types.br_table.wast
: this fails due to incomplete support for the various syntactic sugar in the wasm-tools/wast
crate. See bytecodealliance/wasm-tools/pull/952.ref_null.wast
andlocal_init.wast
: fail due to lack of support in the embedder API.return_call_ref.wast
,return_call_indirect.wast,
andreturn_call.wast
: fail due to lack of tail call support.At the time of writing the implementation does not take advantage of the static non-null safety to elide null checks when executing
call_ref
: https://github.com/bytecodealliance/wasmtime/blob/36e9f7e577df11de14f5973308c4b4bd0565eed9/crates/cranelift/src/func_environ.rs#L1744-L1762