Wasm Research Day 2024 – Chris Fallin, wevaling the wasms: AOT JS Compilation to WebAssembly

18 Views
Published
The WebAssembly Research Center presents talks from Wasm Research Day 2024.
Speaker: Chris Fallin
Affiliation: Fastly
Title: wevaling the wasms: AOT JS Compilation to WebAssembly
Abstract: Dynamically-typed languages are, at first glance, a poor fit for compilation to WebAssembly: the techniques that make their execution fast in modern contexts, such as JIT compilation and inline caches, are not available or easy to implement in Wasm's static Harvard architecture. The state of the art today is to bundle such languages with their interpreter in a Wasm module. However, it is possible to do better. First, with careful thought, a JIT compiler can sometimes be reframed in a mostly-AOT way, by being explicit about phasing (e.g., collection of common inline-cache snippets ahead of time). Hybrid design points can be achieved where some dynamism -- late-binding via indirection -- can coexist with compiled code bodies. Finally, we can make it easier to turn an existing interpreter into a compiler with partial evaluation. This talk introduces weval, the Wasm partial evaluator, and its use to compile JavaScript ahead-of-time with the SpiderMonkey engine, showing good speedups.
Sign in or sign up to post comments.
Be the first to comment