skip to content
[readonly]
==> README.md <==
1# @ajax/wasm-lower
2
3Lowers validated WebAssembly function bodies to the flat code `@ajax/wasm-interp` runs. Structured
4control flow becomes jumps: every branch names its target instruction, the operand-stack height (in
564-bit slots from the frame base) its label's values move to, and how many values move; `br_table`
6entries live in a side table. Locals are the frame's first slots, the operand stack follows, and each
7function records the deepest stack it can reach, so a call checks its stack space once. Loop headers
8carry an interrupt check (wasmtime's epoch checks sit at loop headers and function entries). Dead code
9after `br`, `br_table`, `return` and `unreachable` is dropped. Bodies with SIMD or atomics are refused
10("SIMD is not supported by this executor"). `wasm_canonical_types` gives call_indirect's structural
11type identity.
12
13Part of alpha-c-mesh's WebAssembly interpreter, which replaces wasmtime's Cranelift in the port of
14alpha-rust-mesh's `mesh-host/src/wasm.rs`.
15
16Tests: through `@ajax/wasm-interp` (spec-style, differential against native code, and fuzzing).