Premium
Vmgen—a generator of efficient virtual machine interpreters
Author(s) -
Ertl M. Anton,
Gregg David,
Krall Andreas,
Paysan Bernd
Publication year - 2002
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.434
Subject(s) - interpreter , computer science , code generation , programming language , compiled language , compiler , generator (circuit theory) , virtual machine , machine code , code (set theory) , java , tracing , source code , operating system , high level programming language , power (physics) , physics , set (abstract data type) , quantum mechanics , key (lock) , programming paradigm
Abstract 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