|
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
|
Joel Auslander , Matthai Philipose , Craig Chambers , Susan J. Eggers , Brian N. Bershad, Fast, effective dynamic compilation, Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation, p.149-159, May 21-24, 1996, Philadelphia, Pennsylvania, United States
|
 |
2
|
B. N. Bershad , S. Savage , P. Pardyak , E. G. Sirer , M. E. Fiuczynski , D. Becker , C. Chambers , S. Eggers, Extensibility safety and performance in the SPIN operating system, Proceedings of the fifteenth ACM symposium on Operating systems principles, p.267-283, December 03-06, 1995, Copper Mountain, Colorado, United States
|
 |
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
|
C. Chambers , D. Ungar, Customization: optimizing compiler technology for SELF, a dynamically-typed object-oriented programming language, Proceedings of the ACM SIGPLAN 1989 Conference on Programming language design and implementation, p.146-160, June 19-23, 1989, Portland, Oregon, United States
|
 |
7
|
|
 |
8
|
|
 |
9
|
|
| |
10
|
|
 |
11
|
Dawson R. Engler , Todd A. Proebsting, DCG: an efficient, retargetable dynamic code generation system, Proceedings of the sixth international conference on Architectural support for programming languages and operating systems, p.263-272, October 05-07, 1994, San Jose, California, United States
|
 |
12
|
Dawson R. Engler, VCODE: a retargetable, extensible, very fast dynamic code generation system, Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation, p.160-170, May 21-24, 1996, Philadelphia, Pennsylvania, United States
|
 |
13
|
Dawson R. Engler , Wilson C. Hsieh , M. Frans Kaashoek, C: a language for high-level, efficient, and machine-independent dynamic code generation, Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.131-144, January 21-24, 1996, St. Petersburg Beach, Florida, United States
[doi> 10.1145/237721.237765]
|
 |
14
|
D. R. Engler , M. F. Kaashoek , J. O'Toole, Jr., Exokernel: an operating system architecture for application-level resource management, Proceedings of the fifteenth ACM symposium on Operating systems principles, p.251-266, December 03-06, 1995, Copper Mountain, Colorado, United States
|
| |
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
|
Brian Grant , Markus Mock , Matthai Philipose , Craig Chambers , Susan J. Eggers, Annotation-directed run-time specialization in C, Proceedings of the 1997 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, p.163-178, June 12-13, 1997, Amsterdam, The Netherlands
|
| |
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
|
Massimiliano Poletto , Dawson R. Engler , M. Frans Kaashoek, tcc: a system for fast, flexible, and high-level dynamic code generation, Proceedings of the ACM SIGPLAN 1997 conference on Programming language design and implementation, p.109-121, June 16-18, 1997, Las Vegas, Nevada, United States
|
 |
32
|
|
| |
33
|
|
 |
34
|
C. Pu , T. Autrey , A. Black , C. Consel , C. Cowan , J. Inouye , L. Kethana , J. Walpole , K. Zhang, Optimistic incremental specialization: streamlining a commercial operating system, Proceedings of the fifteenth ACM symposium on Operating systems principles, p.314-321, December 03-06, 1995, Copper Mountain, Colorado, United States
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sam Kamin, Routine run-time code generation, Companion of the 18th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, October 26-30, 2003, Anaheim, CA, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Christopher Mueller , Andrew Lumsdaine, Runtime synthesis of high-performance code from scripting languages, Companion to the 21st ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
|
|
|
Albert Cohen , Sébastien Donadio , Maria-Jesus Garzaran , Christoph Herrmann , Oleg Kiselyov , David Padua, In search of a program generator to implement generic transformations for high-performance computing, Science of Computer Programming, v.62 n.1, p.25-46, September 2006
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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...
|