Virtual machine showdown
Yunhe Shi, David Gregg, Andrew Beatty et al. · 2005
Virtual machines (VMs) are commonly used to distribute programs in an architecture-neutral format, which can easily be interpreted or compiled. A long-running question in the design of VMs is whether stack architecture or register architecture can be implemented more efficiently with an interpreter. We extend existing work on comparing virtual stack and virtual register architectures in two ways. Firstly, our translation from stack to register code is much more sophisticated. The result is that we eliminate an average of more than 47% of executed VM instructions, with the register machine bytecode size only 25% larger than that of the corresponding stack bytecode. Secondly we present an implementation of a register machine in a fully standard-compliant implementation of the Java VM. We find that, on the Pentium 4, the register architecture requires an average of 32.3% less time to execute standard benchmarks if dispatch is performed using a C switch statement. Even if more efficient threaded dispatch is available (which requires labels as first class values), the reduction in running time is still approximately 26.5% for the register architecture.
Cited by 38 works. doi:10.1145/1064979.1065001
Authors
References
- Optimizing direct threaded code by selective inlining
- Java intermediate bytecodes
- Iterated register coalescing
- Java Intermediate Bytecode.
- Stack caching for interpreters
- The case against stack-oriented instruction sets
- The Behavior of Efficient Virtual Machine Interpreters on Modern Architectures
- Context Threading: A Flexible and Efficient Dispatch Technique for Virtual Machine Interpreters
- The case for virtual register machines
- Optimistic register coalescing