Affiliation:
1. Sungkyunkwan University, Suwon, Korea
Abstract
Interpreters are widely used to implement high-level language virtual machines (VMs), especially on resource-constrained embedded platforms. Many scripting languages employ interpreter-based VMs for their advantages over native code compilers, such as portability, smaller resource footprint, and compact codes. For efficient interpretation a script (program) is first compiled into an intermediate representation, or
bytecodes
. The canonical interpreter then runs an infinite loop that fetches, decodes, and executes one bytecode at a time. This bytecode dispatch loop is a well-known source of inefficiency, typically featuring a large jump table with a hard-to-predict indirect jump. Most existing techniques to optimize this loop focus on reducing the misprediction rate of this indirect jump in both hardware and software. However, these techniques are much less effective on embedded processors with shallow pipelines and low IPCs.
Instead, we tackle another source of inefficiency more prominent on embedded platforms--redundant computation in the dispatch loop. To this end, we propose Short-Circuit Dispatch (SCD), a low-cost architectural extension that enables fast, hardware-based bytecode dispatch with fewer instructions. The key idea of SCD is to overlay the software-created bytecode jump table on a branch target buffer (BTB). Once a bytecode is fetched, the BTB is looked up using the bytecode, instead of PC, as key. If it hits, the interpreter directly jumps to the target address retrieved from the BTB; otherwise, it goes through the original dispatch path. This effectively eliminates redundant computation in the dispatcher code for decode, bound check, and target address calculation, thus significantly reducing total instruction count. Our simulation results demonstrate that SCD achieves geomean speedups of 19.9% and 14.1% for two production-grade script interpreters for Lua and JavaScript, respectively. Moreover, our fully synthesizable RTL design based on a RISC-V embedded processor shows that SCD improves the EDP of the Lua interpreter by 24.2%, while increasing the chip area by only 0.72% at a 40nm technology node.
Publisher
Association for Computing Machinery (ACM)
Reference38 articles.
1. "Node.js - open-source runtime environment for developing server-side web applications." https://nodejs.org "Node.js - open-source runtime environment for developing server-side web applications." https://nodejs.org
2. "WebOS - linux kernel-based multitask operating system for smart devices." http://www.openwebosproject.org "WebOS - linux kernel-based multitask operating system for smart devices." http://www.openwebosproject.org
3. "TIZEN." https://www.tizen.org "TIZEN." https://www.tizen.org
4. "Python." https://www.python.org "Python." https://www.python.org
5. "Ruby." https://www.ruby-lang.org "Ruby." https://www.ruby-lang.org
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Typed Architectures;ACM SIGPLAN Notices;2017-05-12
2. Typed Architectures;ACM SIGARCH Computer Architecture News;2017-05-11
3. Typed Architectures;Proceedings of the Twenty-Second International Conference on Architectural Support for Programming Languages and Operating Systems;2017-04-04
4. Typed Architectures;ACM SIGOPS Operating Systems Review;2017-04-04