Dynamic native optimization of interpreters

GT Sullivan, DL Bruening, I Baron, T Garnett… - Proceedings of the …, 2003 - dl.acm.org
GT Sullivan, DL Bruening, I Baron, T Garnett, S Amarasinghe
Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators, 2003dl.acm.org
For domain specific languages," scripting languages", dynamic languages, and for virtual
machine-based languages, the most straightforward implementation strategy is to write an
interpreter. A simple interpreter consists of a loop that fetches the next bytecode, dispatches
to the routine handling that bytecode, then loops. There are many ways to improve upon this
simple mechanism, but as long as the execution of the program is driven by a representation
of the program other than as a stream of native instructions, there will be some" interpretive …
For domain specific languages, "scripting languages", dynamic languages, and for virtual machine-based languages, the most straightforward implementation strategy is to write an interpreter. A simple interpreter consists of a loop that fetches the next bytecode, dispatches to the routine handling that bytecode, then loops. There are many ways to improve upon this simple mechanism, but as long as the execution of the program is driven by a representation of the program other than as a stream of native instructions, there will be some "interpretive overhead".There is a long history of approaches to removing interpretive overhead from programming language implementations. In practice, what often happens is that, once an interpreted language becomes popular, pressure builds to improve performance until eventually a project is undertaken to implement a native Just In Time (JIT) compiler for the language. Implementing a JIT is usually a large effort, affects a significant part of the existing language implementation, and adds a significant amount of code and complexity to the overall code base.In this paper, we present an innovative approach that dynamically removes much of the interpreted overhead from language implementations, with minimal instrumentation of the original interpreter. While it does not give the performance improvements of hand-crafted native compilers, our system provides an appealing point on the language implementation spectrum.
ACM Digital Library