Implementing an Efficient Java Interpreter

David Gregg and M. Anton Ertll and Andreas Krall

Institut für Computersprachen
Technische Universität Wien
Argentinierstraße 8
A-1040 Wien, Austria

Department of Computer Science
Trinity College
Dublin 2, Ireland

{andi, anton}@complang.tuwien.ac.at
David.Gregg@cs.tcd.ie

Abstract

The Java virtual machine (JVM) is usually implemented with an interpreter or just-in-time (JIT) compiler. JIT compilers provide the best performance, but must be substantially rewritten for each architecture they are ported to. Interpreters are easier to develop and maintain, and can be ported to new architectures with almost no changes. The weakness of interpreters is that they are much slower than JIT compilers. This paper describes work in progress on a highly efficient Java interpreter. We describe the main features that make our interpreter efficient. Our initial experimental results show that an interpreter-based JVM may be only 1.9 times slower than a compiler-based JVM for some important applications.