Vmgen—a generator of efficient virtual machine interpreters

In a virtual machine interpreter, the code for each virtual machine instruction has similarities to code for other instructions. We present an interpreter generator that takes simple virtual machine instruction descriptions as input and generates C code for processing the instructions in several ways: execution, virtual machine code generation, disassembly, tracing, and profiling. The generator is designed to support efficient interpreters: it supports threaded code, aching the top‐of‐stack item in a register, combining simple instructions into superinstructions, and other optimizations. We have used the generator to create interpreters for Forth and Java. Theresulting interpreters are faster than other interpreters for the same languages and they are typically 2–10 times slower than code produced by native‐code compilers. We also present results for the effects of the individual optimizations supported by the generator. Copyright © 2002 John Wiley & Sons, Ltd

[1]  James R. Bell,et al.  Threaded code , 1973, CACM.

[2]  Robert B. K. Dewar,et al.  Indirect threaded code , 1975, Commun. ACM.

[3]  Paul Klint,et al.  Interpretation Techniques , 1981, Softw. Pract. Exp..

[4]  Glenn Krasner,et al.  Smalltalk-80: bits of history, words of advice , 1983 .

[5]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[6]  T. Pittman Two-level hybrid interpreter/native code execution for combined space-time program efficiency , 1987, PLDI 1987.

[7]  Jan M. Van Campenhout,et al.  Interpretation and instruction path coprocessing , 1990, Computer systems.

[8]  Manuel Alfonseca,et al.  The APL IL Interpreter Generator , 1991, IBM Syst. J..

[9]  Hassan Aït-Kaci,et al.  Warren's Abstract Machine: A Tutorial Reconstruction , 1991 .

[10]  M. Anton Ertl A Portable Forth Engine , 1993 .

[11]  Jonathan Rees,et al.  A tractable Scheme implementation , 1994, LISP Symb. Comput..

[12]  Todd A. Proebsting Optimizing an ANSI C interpreter with superoperators , 1995, POPL '95.

[13]  M. Anton Ertl,et al.  Stack caching for interpreters , 1995, PLDI '95.

[14]  Alec Wolman,et al.  The structure and performance of interpreters , 1996, ASPLOS VII.

[15]  Dawson R. Engler,et al.  VCODE: a retargetable, extensible, very fast dynamic code generation system , 1996, PLDI '96.

[16]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[17]  Bertil Folliot,et al.  A dynamically configurable, multi-language execution platform , 1998, ACM SIGOPS European Workshop.

[18]  Andreas Krall,et al.  Monitors and exceptions: how to implement Java efficiently , 1998 .

[19]  Ian Piumarta,et al.  Optimizing direct threaded code by selective inlining , 1998, PLDI 1998.

[20]  Andreas Krall,et al.  Monitors and Exceptions: How to Implement Java Efficiently , 1998, Concurr. Pract. Exp..

[21]  Lex Augusteijn,et al.  A code compression system based on pipelined interpreters , 1999 .

[22]  Lex Augusteijn,et al.  A code compression system based on pipelined interpreters , 1999, Softw. Pract. Exp..

[23]  Vítor Santos Costa,et al.  Optimising Bytecode Emulation for Prolog , 1999, PPDP.

[24]  Lex Augusteijn,et al.  Pipelined Java Virtual Machine Interpreters , 2000, CC.

[25]  Implementing an Efficient Java Interpreter , 2001, HPCN Europe.

[26]  David Gregg,et al.  The Behavior of Efficient Virtual Machine Interpreters on Modern Architectures , 2001, Euro-Par.