Title: Language and compiler support for dynamic code generation
Abstract: Dynamic code generation, also called run-time code generation or dynamic compilation, is the creation of executable code for an application while that application is running. Dynamic compilation can significantly improve the performance of software by giving the compiler access to run-time information that is not available to a traditional static compiler. A well-designed programming interface to dynamic compilation can also simplify the creation of important classes of computer programs. Until recently, however, no system combined efficient dynamic generation of high-performance code with a powerful and portable language interface. This thesis describes a system that meets these requirements, and discusses several applications of dynamic compilation.
First, the thesis presents 'C (pronounced “Tick-C”), an extension to ANSI C that allows the programmer to express and manipulate C code fragments that should be compiled at run time. 'C is currently the only language to provide an imperative programming interface suitable for high-performance dynamic compilation. It can be used both as an optimization, to improve performance relative to static C code, and as a software engineering tool, to simplify software that involves compilation and interpretation.
Second, the thesis proposes several algorithms for fast but effective dynamic compilation, including fast register allocation, data flow analysis, and peephole optimization. It introduces a set of dynamic compilation benchmarks, and uses them to evaluate these algorithms both in isolation and as part of an entire 'C implementation, tcc. Dynamic 'C code can be significantly faster than equivalent static code compiled by an optimizing C compiler: two- to four-fold speedups are common on the benchmarks in this thesis. Furthermore, tcc generates code efficiently—at an overhead of about 100 to 600 cycles per generated instruction—which makes dynamic compilation practical in many situations.
Finally, the thesis establishes a taxonomy of dynamic optimizations. It highlights strategies for improving code with dynamic compilation, discusses their limits, and illustrates their use in several application areas. (Copies available exclusively from MIT Libraries, Rm. 14-0551, Cambridge, MA 02139-4307. Ph. 617-253-5668; Fax 617-253-1690.)
Publication Year: 1999
Publication Date: 1999-01-01
Language: en
Type: dissertation
Access and Citation
Cited By Count: 5
AI Researcher Chatbot
Get quick answers to your questions about the article from our AI researcher chatbot