Virtual machine showdown

Yunhe Shi, David Gregg, Andrew Beatty, M. Anton Ertl
2005 Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments - VEE '05  
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
more » ... 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 standardcompliant 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.
doi:10.1145/1064979.1065001 dblp:conf/vee/ShiGBE05 fatcat:3oygsgktdngtbi5o5n73ddntvm