ACM Home Page
Please provide us with feedback. Feedback
C and tcc: a language and compiler for dynamic code generation
Full text PdfPdf (472 KB)
Source ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 21 ,  Issue 2  (March 1999) table of contents
Pages: 324 - 369  
Year of Publication: 1999
ISSN:0164-0925
Authors
Massimiliano Poletto  Massachusetts Institute of Technology, Cambridge
Wilson C. Hsieh  Univ. of Utah, Salt Lake City
Dawson R. Engler  Massachusetts Institute of Technology, Cambridge
M. Frans Kaashoek  Massachusetts Institute of Technology, Cambridge
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 18,   Downloads (12 Months): 113,   Citation Count: 35
Additional Information:

abstract   references   cited by   index terms   review   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/316686.316697
What is a DOI?

ABSTRACT

Dynamic code generation allows programmers to use run-time information in order to achieve performance and expressiveness superior to those of static code. The 'C(Tick C) language is a superset of ANSI C that supports efficient and high-level use of dynamic code generation. 'C provides dynamic code generation at the level of C expressions and statements and supports the composition of dynamic code at run time. These features enable programmers to add dynamic code generation to existing C code incrementally and to write important applications (such as “just-in-time” compilers) easily. The article presents many examples of how 'C can be used to solve practical problems. The tcc compiler is an efficient, portable, and freely available implementation of 'C. tcc allows programmers to trade dynamic compilation speed for dynamic code quality: in some aplications, it is most important to generate code quickly, while in others code quality matters more than compilation speed. The overhead of dynamic compilation is on the order of 100 to 600 cycles per generated instruction, depending on the level of dynamic optimizaton. Measurements show that the use of dynamic code generation can improve performance by almost an order of magnitude; two- to four-fold speedups are common. In most cases, the overhead of dynamic compilation is recovered in under 100 uses of the dynamic code; sometimes it can be recovered within one use.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
2
3
 
4
BRIGGS, P. AND HARVEY, T. 1994. Multiplication by integer constants. http ://softlib. rice. edu/MSCP.
 
5
CHAITIN, G. J., AUSLANDER, M. A., CHANDRA, A. K., COCKE, J., HOPKINS, M. E., AND MARK- STEIN, P. W. 1981. Register allocation via coloring. Comput. Lang. 6, 47-57.
6
7
8
9
 
10
11
12
13
14
 
15
 
16
FRASER, C. W. 1980. copt. ftp ://ftp. cs.princeton, edu/pub/ lcc/contrib/copt, shar.
 
17
FRASER, C. W. AND HANSON, D. R. 1990. A code generation interface for ANSI C. Technical Report CS-TR-270-90, Department of Computer Science, Princeton University.
 
18
19
20
 
21
22
 
23
KELSEY, R., CLINGER, W., REES, J., (EDITORS), ET AL. 1998. Revised5 Report on the Algorithmic Language Scheme. http ://www-swiss. ai. mit. edu/~j affer/r5rs_toc, html.
24
 
25
KEPPEL, D., EGGERS, S., AND HENRY, R. 1991. A case for runtime code generation. Tech. Rep. 91-11-04, University of Washington.
 
26
KEPPEL, D., EGGERS, S., AND HENRY, R. 1993. Evaluating runtime-compiled value-specific optimizations. Tech. Rep. 93-11-02, Department of Computer Science and Engineering, University of Washington.
 
27
LEONE, M. AND DYBVIG, R. K. 1997. Dynamo: A staged compiler architecture for dynamic program optimization. Tech. Rep. 490, Indiana University Computer Science Department.
28
 
29
 
30
PIKE, R., LOCANTHI, B., AND REISER, J. 1985. Hardware/software trade-offs for bitmap graphics on the Blit. Softw. Pract. Exper. 15, 2 (Feb.), 131-151.
31
32
 
33
34
 
35
Pu, C., iV{ASSALIN, H., AND IOANNIDIS, J. 1988. The Synthesis kernel. Comput. Syst. 1, 1, 11-32.
 
36
 
37
38
 
39
 
40
41

CITED BY  35


REVIEW

"Jan Hendrik Jongejan : Reviewer"

The authors present 'C, an extension of C that allows the use of dynamic code generation (which is type-checked statically) by marking C expressions using a back-quote. 'C also allows users to compose arbitrary dynamic code at runtime. This al  more...

Collaborative Colleagues:
Massimiliano Poletto: colleagues
Wilson C. Hsieh: colleagues
Dawson R. Engler: colleagues
M. Frans Kaashoek: colleagues