Deferred Compilation: The Automation of Run-Time Code Generation

This paper describes deferred compilation, an alternative and complement to compile-time program analysis and optimization. By deferring aspects of compilation to run time, exact information about programs can be exploited, leading to greater opportunities for code improvement. This is in contrast to the use of static analyses, which are inherently conservative. Deferred compilation automates the translation of ordinary programs into native machine code that performs fast optimization and native-code generation at run time. Automation is obtained through the use of a compile-time staging analysis, which determines the portions of a program that may be safely and profitably compiled at run time. Fast run-time optimization is obtained by trading space for time: compile-time specialization yields numerous run-time code generators, each customized to optimize a small portion of the source program based on run-time information. Implementation strategies developed for a prototype compiler are discussed, and the results of preliminary experiments demonstrating significant overall speedup are presented.

[1]  Bell Telephone,et al.  Regular Expression Search Algorithm , 1968 .

[2]  Gregory J. Chaitin,et al.  Register allocation and spilling via graph coloring , 2004, SIGP.

[3]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[4]  Henry Massalin,et al.  Synthesis: an efficient implementation of fundamental operating system services , 1992 .

[5]  Peter Lee,et al.  Cache behavior of combinator graph reduction , 1992, TOPL.

[6]  Charles Consel,et al.  New Insights into Partial Evaluation: the SCHISM Experiment , 1988, ESOP.

[7]  David W. Wall,et al.  A practical system fljr intermodule code optimization at link-time , 1993 .

[8]  Calton Pu,et al.  Incremental partial evaluation: the key to high performance, modularity and portability in operating systems , 1993, PEPM '93.

[9]  John C. Mitchell,et al.  Higher-order modules and the phase distinction , 1989, POPL '90.

[10]  Susan J. Eggers,et al.  A case for runtime code generation , 1993 .

[11]  John L. Hennessy,et al.  Register allocation by priority-based coloring , 1984, SIGPLAN '84.

[12]  Calton Pu,et al.  Threads and input/output in the synthesis kernal , 1989, SOSP '89.

[13]  Robert Harper,et al.  Note on Conditional Compilation in Standard ML , 1993 .

[14]  David W. Wall,et al.  Predicting program behavior using real or estimated profiles , 2004, SIGP.

[15]  Andrew W. Appel,et al.  Re-opening Closures , 1988 .

[16]  Marc Feeley,et al.  Closure Generation Based on Viewing Lambda as Epsilon Plus Compile , 1992, Comput. Lang..

[17]  Andrew A. Berlin,et al.  Compiling scientific code using partial evaluation , 1990, Computer.

[18]  Peter Lee,et al.  Standard ML Signatures for a Protocol Stack , 1993 .

[19]  William L. Scherlis,et al.  Compilers and staging transformations , 1986, POPL '86.

[20]  Flemming Nielson,et al.  Two-level functional languages , 1992, Cambridge tracts in theoretical computer science.

[21]  Ken Kennedy,et al.  A Methodology for Procedure Cloning , 1993, Computer languages.

[22]  Neil D. Jones,et al.  Mix: A self-applicable partial evaluator for experiments in compiler generation , 1989, LISP Symb. Comput..

[23]  Lars Birkedal,et al.  Partial Evaluation of Standard ML Master's Thesis , 1993 .

[24]  Karel De Vlaminck,et al.  Program Bifurcation for a Polymorphic Typed Functional Language , 1991, PEPM.

[25]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.