Navigation bar Home page Ongoing projects SOR publications SOR members Industrial relations


Delayed Code Generation in a Smalltalk-80 Compiler

Author: Ian Piumarta
Source: Ph.D. thesis, submitted to the University of Manchester (UK), October 1992.
In English.

Abstract:

More than any other programming system, Smalltalk-80 stretches the object-oriented paradigm to its limits. Representing all programmer-accessible data (input and output facilities, contexts, processes, functions, and so on) as objects is the cause of many implementation difficulties. Polymorphism, the dynamic binding of function names to function bodies at runtime, and the transparent management of dynamic memory allocation only aggravate the situation further.

Traditional implementations (in other words, all the commercially available implementations) try to narrow the semantic gap between the language and the platform upon which it runs by compiling Smalltalk for an idealized virtual machine that uses simple language-oriented instructions. This approach has advantages for both the compiler writer (the target language is optimized for running programs written in the source language) and for the runtime system (compiled code is small and easy to map back to the source for debugging). Reducing the complexity of the compiler also speeds up compilation, which is highly desirable in exploratory programming environments such as Smalltalk-80. The down side is that reducing the complexity of the compiler and target language causes a corresponding increase in complexity in the runtime system which has to work much harder if it is to ensure efficient execution of code.

This thesis argues and demonstrates that it is possible to compile Smalltalk-80 directly into machine code for stock hardware, and to do this efficiently in terms of both compiler performance (the compiler must be small and fast) and generated code performance. The techniques developed for `delayed code generation' in single-pass recursive descent compilation (or code generation by walking a parse tree) are applicable to almost any language, and some discussion of the application of delayed code generation to the compilation of C is also presented.

Some investigation into the applicability and effectiveness of various compile- and run-time optimisations is presented, qualified by benchmark results covering a wide range of activities from critical operations (such as integer arithmetic) to entire subsystems (such as the Smalltalk text display interface).

Keywords:

Code generation, Smalltalk-80, object-oriented languages, object-oriented systems, programming language implementation.

Click on the following buttons:


See also:

Brigitte Larue, INRIA Rocquencourt, Domaine de Voluceau, BP 105, 78153 Le Chesnay, France. tel. +33 (1) 39-63-55-40, fax: +33 (1) 39 63 53 72. E-mail: Brigitte.Larue@inria.fr
Last modified: Fri Aug 7 10:13:48 MET DST 1998
Aline Baggio