ABSTRACT
Virtual machines (VMs) are a popular target for language implementers. Conventional wisdom tells us that virtual stack architectures can be implemented with an interpreter more efficiently, since the location of operands is implicit in the stack pointer. In contrast, the operands of register machine instructions must be specified explicitly. In this paper, we present a working system for translating stack-based Java virtual machine (JVM) code to a simple register code. We describe the translation process, the complicated parts of the JVM which make translation more difficult, and the optimisations needed to eliminate copy instructions. Experimental results show that a register format reduces the number of executed instructions by 34.88%, while increasing the number of bytecode loads by an average of 44.81%. Overall, this corresponds to an increase of 2.32 loads for each dispatch removed. We believe that the high cost of dispatches makes register machines attractive even at the cost of increased loads.
- M. Bull, L. Smith, M. Westhead, D. Henty, and R. Davey. Benchmarking Java Grande applications. In Second International Conference and Exhibition on the Practical Application of Java, Manchester, UK, April 2000.]]Google Scholar
- M. A. Ertl. Stack caching for interpreters. In SIGPLAN '95 Conference on Programming Language Design and Implementation, pages 315--327, 1995.]] Google ScholarDigital Library
- M. A. Ertl and D. Gregg. The behaviour of efficient virtual machine interpreters on modern architectures. In Euro-Par 2001, pages 403--412. Springer LNCS 2150, 2001.]] Google ScholarDigital Library
- M. A. Ertl, D. Gregg, A. Krall, and B. Paysan. vmgen --- A generator of efficient virtual machine interpreters. Software---Practice and Experience, 32(3):265--294, 2002.]] Google ScholarDigital Library
- E. Gagnon. A Portable Research Framework for the Execution of Java Bytecode. PhD thesis, Mc Gill University, December 2002.]] Google ScholarDigital Library
- E. Gagnon and L. Hendren. SableVM: A research framework for the efficient execution of Java bytecode. In First USENIX Java Virtual Machine Research and Technology Symposium, Monterey, California, April 2001.]] Google ScholarDigital Library
- E. Gagnon and L. Hendren. Effective inline-threaded interpretation of java bytecode using preparation sequences. In Proceedings of the 12th International Conference on Compiler Construction, LNCS 2622, pages 170--184, April 2003.]]Google ScholarCross Ref
- D. Gregg, A. Ertl, and A. Krall. A fast java interpreter. In Proceedings of the Workshop on Java optimisaton strategies for embedded systems (JOSES), Genoa, April 2001.]]Google Scholar
- J. Hoogerbrugge, L. Augusteijn, J. Trum, and R. van de Wiel. A code compression system based on pipelined interpreters. Software---Practice and Experience, 29(11):1005--1023, Sept. 1999.]] Google ScholarCross Ref
- G. J. Myers. The case against stack-oriented instruction sets. Computer Architecture News, 6(3):7--10, 1977.]] Google ScholarDigital Library
- I. Piumarta and F. Riccardi. Optimizing direct threaded code by selective inlining. In SIGPLAN '98 Conference on Programming Language Design and Implementation, pages 291--300, 1998.]] Google ScholarDigital Library
- T. A. Proebsting. Optimizing an ANSI C interpreter with superoperators. In Principles of Programming Languages (POPL '95), pages 322--332, 1995.]] Google ScholarDigital Library
- V. Santos Costa. Optimising bytecode emulation for Prolog. In LNCS 1702, Proceedings of PPDP'99, pages 261--267. Springer-Verlag, September 1999.]] Google ScholarDigital Library
- SPEC. SPEC releases SPEC JVM98, first industry-standard benchmark for measuring Java virtual machine performance. Press Release, August 19 1998. http://www.specbench.org/osg/jvm98/press.html.]]Google Scholar
- D. Sugalski. http://www.parrotcode.org/.]]Google Scholar
- J. Waldron. Dynamic bytecode usage by object oriented java programs. In Proceedings of the Technology of Object-Oriented Languages and Systems 29th International Conference and Exhibition, Nancy, France, June 7--10 1999.]] Google ScholarDigital Library
Index Terms
- The case for virtual register machines
Recommendations
RegCPython: A Register-based Python Interpreter for Better Performance
Interpreters are widely used in the implementation of many programming languages, such as Python, Perl, and Java. Even though various JIT compilers emerge in an endless stream, interpretation efficiency still plays a critical role in program performance. ...
Virtual machine showdown: Stack versus registers
Virtual machines (VMs) enable the distribution of programs in an architecture-neutral format, which can easily be interpreted or compiled. A long-running question in the design of VMs is whether a stack architecture or register architecture can be ...
Virtual machine showdown: stack versus registers
VEE '05: Proceedings of the 1st ACM/USENIX international conference on Virtual execution environmentsVirtual 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 ...
Comments