Affiliation:
1. Carnegie Mellon University, USA
Abstract
WebAssembly (Wasm) is a compact, well-specified bytecode format that offers a portable compilation target with near-native execution speed. The bytecode format was specifically designed to be fast to parse, validate, and compile, positioning itself as a portable alternative to native code. It was pointedly not designed to be interpreted directly. Instead, design considerations at the time focused on competing with native code, utilizing optimizing compilers as the primary execution tier. Yet, in JIT scenarios, compilation time and memory consumption critically impact application startup, leading many Wasm engines to later deploy faster single-pass (baseline) compilers. Though faster, baseline compilers still take time and waste code space for infrequently executed code. A typical interpreter being infeasible, some engines resort to compiling Wasm not to machine code, but to a more compact, but easy to interpret format. This still takes time and wastes memory. Instead, we introduce in this article a fast in-place interpreter for WebAssembly, where no rewrite and no separate format is necessary. Our evaluation shows that in-place interpretation of Wasm code is space-efficient and fast, achieving performance on-par with interpreting a custom-designed internal format. This fills a hole in the execution tier space for Wasm, allowing for even faster startup and lower memory footprint than previous engine configurations.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference73 articles.
1. 1998. Hotspot internals: interpreter. https://openjdk.java.net/groups/hotspot/docs/RuntimeOverview.html (Accessed 2022-4-07) 1998. Hotspot internals: interpreter. https://openjdk.java.net/groups/hotspot/docs/RuntimeOverview.html (Accessed 2022-4-07)
2. 2015. lli - directly execute programs from LLVM bitcode. https://llvm.org/docs/CommandGuide/lli.html (Accessed 2022-4-12) 2015. lli - directly execute programs from LLVM bitcode. https://llvm.org/docs/CommandGuide/lli.html (Accessed 2022-4-12)
3. 2018. https://v8.dev/blog/liftoff (Accessed 2022-4-07) 2018. https://v8.dev/blog/liftoff (Accessed 2022-4-07)
4. 2018. TurboFan: V8’s Optimizing Compiler. https://v8.dev/docs/turbofan (Accessed 2021-07-29) 2018. TurboFan: V8’s Optimizing Compiler. https://v8.dev/docs/turbofan (Accessed 2021-07-29)
5. 2018. WAVM: a non-browser WebAssembly virtual machine. https://github.com/WAVM/WAVM (Accessed 2022-1-10) 2018. WAVM: a non-browser WebAssembly virtual machine. https://github.com/WAVM/WAVM (Accessed 2022-1-10)
Cited by
9 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. BIFROST: A Future Graph Database Runtime;2024 IEEE 40th International Conference on Data Engineering (ICDE);2024-05-13
2. Flexible Non-intrusive Dynamic Instrumentation for WebAssembly;Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3;2024-04-27
3. Whose Baseline Compiler is it Anyway?;2024 IEEE/ACM International Symposium on Code Generation and Optimization (CGO);2024-03-02
4. On Abstract Machines Security and Performance;Procedia Computer Science;2024
5. AST vs. Bytecode: Interpreters in the Age of Meta-Compilation;Proceedings of the ACM on Programming Languages;2023-10-16