Home

tcc: a template-based compiler for `C


Author(s) : M. Frans Kaashoek Dawson R. Engler Massimiliano Poletto, 
Publisher : N/A
Publication Date : 1996
ISSN : N/A
Abstract : Dynamic code generation is an important technique for improving the performance of software by exploiting information known only at run time. `C (Tick C) is a superset of ANSI C that, unlike most prior systems, allows high-level, efficient, and machineindependent specification of dynamically generated code. `C provides facilities for dynamic code generation within the context of a statically typed, imperative language closely related to the language most widely used in systems development. This paper describes tcc, a compiler currently being written for `C. tcc has two objectives: (1) to deliver a complete, solid implementation of `C, and (2) to minimize the run-time costs of dynamic code generation. tcc implements dynamic code generation by emitting templates, segments of binary code which at run time can be combined and completed with the values of registers, stack offsets, and constants. tcc also allows some decisions about storage allocation and instruction selection to occur at run time. This provides flexibility in combining arbitrary pieces of dynamic code, while allowing run-time code generation to occur very efficiently.,