Related articles |
---|
ultra fast but too complex interpreter. hoesel@igc.ethz.ch (1993-03-17) |
ultra fast but too complex interpreter. hosking@cs.umass.edu (1993-03-19) |
Re: ultra fast but too complex interpreter. drw@euler.mit.edu (1993-03-19) |
Newsgroups: | comp.compilers |
From: | hosking@cs.umass.edu (Tony Hosking) |
Keywords: | interpreter, smalltalk |
Organization: | Compilers Central |
References: | 93-03-060 |
Date: | Fri, 19 Mar 1993 16:34:04 GMT |
Our Smalltalk interpreter here at UMass uses a semi-threaded code
approach. The entire interpreter is written in GNU C, with heavy use of
the GNU C labels-as-values extension and register variables for the
registers of the interpreter (or "virtual machine"). Smalltalk code is
compiled to bytecodes in the standard way (see Goldberg and Robson,
"Smalltalk-80: The Language and its Implementation", Addison-Wesley,
1983). Each bytecode is implemented as a labelled fragment of C code, and
we store the label's value (i.e., the code fragment's address) in a global
array. Bytecode dispatch involves indexing this global table with the
bytecode, and branching to the corresponding code fragment. Our
interpreter is both portable (to any machine to which GNU C has been
ported), and fast, benchmarking at around 300% of the Xerox Dorado
micro-coded Smalltalk on a Sparc 2 (about half the speed of commercial
implementations that compile to native code). If we were to go to fully
threaded code we would see even better performance.
Tony Hosking
Papernet: Dept. of Computer Science
University of Massachusetts
Amherst, MA 01003
Voicenet: (413) 545-0256
Internet: hosking@cs.umass.edu
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.