版权所有:内蒙古大学图书馆 技术提供:维普资讯• 智图
内蒙古自治区呼和浩特市赛罕区大学西街235号 邮编: 010021
作者机构:MIT Comp Sci Lab Cambridge MA 02139 USA Univ Utah Salt Lake City UT 84112 USA
出 版 物:《ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS》 (美国计算机学会程序设计语言与系统汇刊)
年 卷 期:1999年第21卷第2期
页 面:324-369页
核心收录:
学科分类:08[工学] 0835[工学-软件工程] 0812[工学-计算机科学与技术(可授工学、理学学位)]
主 题:algorithms languages performance ANSI C compilers dynamic code generation dynamic code optimization
摘 要: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. LC 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 tee compiler is an efficient, portable, and freely available implementation of C. tee allows programmers to trade dynamic compilation speed for dynamic code quality: in some applications, 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 optimization. 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.