版本说明以英文撰写。
The engine now runs WebAssembly
A growing share of the modern web ships compute as WebAssembly - codecs, crypto, whole applications, and increasingly ordinary libraries. The engine had no WebAssembly at all, so any page that instantiated a module failed outright. This release adds a complete WebAssembly engine written from scratch: a binary-format decoder and a stack-machine interpreter for the core instruction set, wired to a real WebAssembly JavaScript API. A page can compile a module, instantiate it, call its exported functions with arguments, and read back its linear memory - the whole round trip. It handles the full integer and floating-point instruction set, structured control flow (blocks, loops, if/else, branch tables), recursion through calls, a mutable global state, and data-initialised memory. Correctness is proven the only honest way: a corpus of modules compiled and RUN by the reference runtime's WebAssembly produces byte-identical results here - arithmetic, a summing loop, recursive Fibonacci, memory load and store, and 64-bit multiply all agree exactly. Unsupported opcodes error honestly rather than compute a wrong answer. Web APIs moves 50 to 52 and overall 52 to 53; this is a whole subsystem the engine did not have.
改动内容
3 项改动- 记忆与阅读A from-scratch WebAssembly decoder (core-js/wasm/decode.rs): the module preamble and section grammar (types, imports, functions, memory, globals, exports, data, start), with structured control flow resolved into flat instructions whose branch targets are pre-computed, so the interpreter branches in constant time.
- 记忆与阅读A stack-machine interpreter (wasm/exec.rs): the full i32/i64/f32/f64 numeric set, comparisons and conversions, memory loads and stores in every width, blocks/loops/if-else with a frame stack, br/br_if/br_table, calls with shared function bodies for cheap recursion, drop/select, and locals/globals. Traps (unreachable, divide by zero, out-of-bounds) surface as errors, never a wrong value.
- 记忆与阅读The JavaScript WebAssembly API (wasm/api.rs + a shim): WebAssembly.validate/compile/instantiate and the Module/Instance constructors, with each instance in a registry and its exports exposed as callable JS functions and its memory as a readable buffer. Proven against the reference runtime's WebAssembly on a byte-identical fixture corpus; whole conformance suite unchanged.












