Abstract
WebAssembly is a promising bytecode virtualization technology for embedded systems. WebAssembly interpreters for embedded demonstrate strong isolation and portability. However, they come with a significant performance penalty compared to direct bare-metal execution or compiled WebAssembly code. This creates demand for interpreter optimization. In this work, we present an approach that increases the execution speed of interpreted WASM code by offloading computed GOTOs, as used in interpreters, to a hardware accelerator. We describe the accelerator’s hardware design, as well as the integration in the popular WebAssembly Micro Runtime (WAMR). To prove the functionality and effectiveness of our approach, we integrate the accelerator into an open-source RISC-V processor core and evaluate WASM interpretation using different benchmarks. Our results show that the approach significantly increases execution speed while only creating minimal code size overhead. Finally, we give an outlook on possible future improvements of the accelerator.
This project received funding from the Chips Joint Undertaking project ISOLDE (No. 101112274) and BMBF project 16MEE0372.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition. https://developer.arm.com/documentation/ddi0406/b/Application-Level-Architecture/Application-Level-Programmers--Model/Execution-environment-support/Jazelle-direct-bytecode-execution-support?lang=en
asm.js. https://asmjs.org
Bristol/Embecosm Embedded Benchmark Suite. https://beebs.mageec.org
Bytecode Alliance. https://bytecodealliance.org/
n-body description (Benchmarks Game). https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/nbody.html
OpenHW Group CV32E40X User Manual. https://docs.openhwgroup.org/projects/cv32e40x-user-manual/en/latest/index.html
RISC-V J Extension. https://github.com/riscv/riscv-j-extension
Thumb Execution Environment (ThumbEE). https://developer.arm.com/documentation/den0013/d/ARM-Architecture-and-Processors/Architecture-history-and-extensions/Thumb-Execution-Environment--ThumbEE-
W3C WebAssembly Working Group. www.w3.org/wasm/
WebAssembly Micro Runtime. https://github.com/bytecodealliance/wasm-micro-runtime
Fumero, J., Stratikopoulos, A., Kotselidis, C.: Running parallel bytecode interpreters on heterogeneous hardware. In: Conference Companion of the 4th International Conference on Art, Science, and Engineering of Programming, Porto, Portugal, pp. 31–35. ACM (2020). https://doi.org/10.1145/3397537.3397563
Haas, A., et al.: Bringing the web up to speed with WebAssembly. In: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 185–200 (2017)
Hoult, B.: Program to count primes. http://hoult.org/primes.txt
Jangda, A., Powers, B., Berger, E.D., Guha, A.: Not so fast: analyzing the performance of WebAssembly vs. native code. In: 2019 USENIX Annual Technical Conference (USENIX ATC 2019), Renton, WA, pp. 107–120. USENIX Association (2019). https://www.usenix.org/conference/atc19/presentation/jangda
Lindholm, T., Yellin, F., Bracha, G., Buckley, A.: The Java Virtual Machine Specification. Addison-Wesley (2013)
O’Connor, J., Tremblay, M.: picoJava-I: the Java virtual machine in hardware. IEEE Micro 17(2), 45–53 (1997). https://doi.org/10.1109/40.592314. http://ieeexplore.ieee.org/document/592314/
Rohou, E., Williams, K., Yuste, D.: Vectorization technology to improve interpreter performance. ACM Trans. Archit. Code Optim. 9(4), 1–22 (2013). https://doi.org/10.1145/2400682.2400685
Wallentowitz, S., Kersting, B., Dumitriu, D.M.: Potential of WebAssembly for embedded systems. In: 2022 11th Mediterranean Conference on Embedded Computing (MECO), pp. 1–4 (2022). https://doi.org/10.1109/MECO55406.2022.9797106
Wang, W.: How far we’ve come - a characterization study of standalone WebAssembly runtimes. In: 2022 IEEE International Symposium on Workload Characterization (IISWC), Austin, TX, USA, pp. 228–241. IEEE (2022). https://doi.org/10.1109/IISWC55918.2022.00028. https://ieeexplore.ieee.org/document/9975423/
Wen, E., Weber, G.: Wasmachine: bring IoT up to speed with a WebAssembly OS. In: 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops), Austin, TX, USA, pp. 1–4. IEEE (2020). https://doi.org/10.1109/PerComWorkshops48775.2020.9156135. https://ieeexplore.ieee.org/document/9156135/
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Rupp, M., Schröter, J., Wallentowitz, S. (2024). Accelerating WebAssembly Interpreters in Embedded Systems Through Hardware-Assisted Dispatching. In: Fey, D., Stabernack, B., Lankes, S., Pacher, M., Pionteck, T. (eds) Architecture of Computing Systems. ARCS 2024. Lecture Notes in Computer Science, vol 14842. Springer, Cham. https://doi.org/10.1007/978-3-031-66146-4_14
Download citation
DOI: https://doi.org/10.1007/978-3-031-66146-4_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-66145-7
Online ISBN: 978-3-031-66146-4
eBook Packages: Computer ScienceComputer Science (R0)