A WebAssembly baseline compiler
A Bytecode Alliance project
Winch is a WebAssembly "baseline" or single-pass compiler designed for Wasmtime.
Winch's primary goal is compilation performance, therefore only certain, very limited peephole optimations are applied.
For more details on the original motivation and goals, refer to the Bytecode Alliance RFC for Baseline Compilation in Wasmtime..
-
Single pass over Wasm bytecode
-
Function as the unit of compilation
-
Machine code generation directly from Wasm bytecode – no intermediate representation
-
Avoid reinventing machine-code emission – use Cranelift's instruction emitter code to create an assembler library
-
Prioritize compilation performance over runtime performance
-
Simple to verify by looking. It should be evident which machine instructions are emitted per WebAssembly operator
-
Adding and iterating on new (WebAssembly and developer-facing) features should be simpler than doing it in an optimizing tier (Cranelift)
Winch's aim is to support all the backends officially supported by Wasmtime:
- x64_64
- arm64
- riscv64
- s390x
The x86_64 backend offers an almost-complete implementation, it currently supports all the instructions that are part of WebAssembly's MVP, plus some of the feature extensions. Refer to the Tiers of Support for more details.