Target code generation from G-machine code

8Citations
Citations of this article
8Readers
Mendeley users who have this article in their library.
Get full text

Abstract

The G-machine is a stack machine for von-Neumann-like execution of lazy functional languages, using graph reduction. This paper describes how target code generation from G-machine code is performed in a compiler for Lazy ML. We briefly review the G-machine, and the compiler phases preceding the target code generation. Two different target code generation methods are described, as well as essential parts of the run-time system. The first target code generator is very simple, generating naïve code by means of ‘macro expansion’. This code explicitly manipulates the stacks exactly as prescribed by the G-machine instructions. A simple peep-hole code improver can remove a fair amount of the most glaring inefficiencies of the naïve code. The second target code generator is less naïve, and takes a more systematic approach to avoid redundant operations in the resulting target code. This code generator can be neatly expressed as an attribute grammar over the G-machine code sequence.

Cite

CITATION STYLE

APA

Johnsson, T. (1987). Target code generation from G-machine code. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 279 LNCS, pp. 119–159). Springer Verlag. https://doi.org/10.1007/3-540-18420-1_53

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free