ABSTRACT
Traditional compilers compile and optimize files separately, making worst-case assumptions about the program context in which a file is to be linked. More aggressive compilation architectures perform cross-file interprocedural or whole-program analyses, potentially producing much faster programs but substantially increasing the cost of compilation. Even more radical are systems that perform all compilation and optimization at run-time: such systems can optimize programs based on run-time program and system properties as well as static whole-program properties. However, run-time compilers (also called dynamic compilers or just-in-time compilers) suffer under severe constraints on allowable compilation time, since any time spent compiling steals from time spent running the program. None of these compilation models dominates the others: each has unique strengths and weaknesses not present in the other models.We are developing a new, staged compilation model which strives to combine high run-time code quality with low compilation overhead. Compilation is organized as a series of stages, with stages corresponding to, for example, separate compilation, library linking, program linking, and run-time execution. Any given optimization can be performed at any of these stages; to reduce compilation time while maintaining high effectiveness, an optimization should be performed at the earliest stage that provides the necessary program context information to carry out the optimization effectively. Moreover, a single optimization can itself be spread across multiple stages, with earlier stages performing preplanning work that enables the final stage to complete the optimization quickly. In this way, we hope to produce highly optimized programs, nearly as good as what could be done with a purely run-time compiler that had an unconstrained compilation time budget, but at a much more practical compile time cost.We are building the Whirlwind optimizing compiler as the concrete embodiment of this staged compilation model, initially targeting object-oriented languages. A key component of Whirlwind is a set of techniques for automatically constructing staged compilers from traditional unstaged compilers, including aggressive applications of specialization and other partial evaluation technology.
- Aldrich et al.Jonathan Aldrich, Craig Chambers, Emin Gun Sirer, and Susan Eggers. Comprehensive Synchronization Elimination for Java. Science of Computer Programming. To appear.]] Google ScholarDigital Library
- Aldrich et al 99.Jonathan Aldrich, Craig Chambers, Emin G~n Sirer, and Susan Eggers. Static Analyses for Eliminating Unnecessary Synchronization from Java Programs. In Proceedings of the Sixth International Static Analysis Symposium, LNCS 1694, pages 19-38, Venice, Italy, September 1999. Springer-Verlag.]] Google ScholarDigital Library
- Arnold et al 00.Matthew Arnold, Stephen Fink, Michael Hind, David Grove, and Peter F. Sweeney. Adaptive Optimization in the Jalape~o JVM. In Proceedings of the 2000 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP00}.]] Google ScholarDigital Library
- Auslander et al 96.Joel Auslander, Matthai Philipose, Craig Chambers, Susan J. Eggers, and Brian N. Bershad. Fast, Effective Dynamic Compilation. In Proceedings of the ACM SIGPLAN '96 Conference on Programming Language Design and Implementation, pages 149-159, May 1996.]] Google ScholarDigital Library
- Blanchet 99.Bruno Blanchet. Escape Analysis for Object-Oriented Languages. Application to Java. In Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP99}.]] Google ScholarDigital Library
- Bogda & Hölzle 99.Jeff Bogda and Urs H~lzle. Removing Unnecessary Synchronization in Java. In Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP99}.]] Google ScholarDigital Library
- Calder et al 97.B. Calder, P. Feller, and A. Eustace. Value Profiling. In Proceedings of the 30th Annual International Symposium on Microarchitecture, pages 259- 269, December 1997.]] Google ScholarDigital Library
- Choi et al 99.Jong-Deok Choi, M. Gupta, Mauricio Serrano, Vugranam C. Sreedhar, and Sam Midkiff. Escape Analysis for Java. In Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP99}.]] Google ScholarDigital Library
- Dean et al 95.Jeffrey Dean, David Grove, and Craig Chambers. Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis. In Proceedings of the 1995 European Conference on Object-Oriented Programming, LNCS 952, Aarhus, Denmark, August 1995. Springer-Verlag.]] Google ScholarDigital Library
- Dean et al 96.Jeffrey Dean, Greg DeFouw, Dave Grove, Vassily Litvinov, and Craig Chambers. Vortex: An Optimizing Compiler for Object-Oriented Languages. In Proceedings of the 1996 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP96}.]] Google ScholarDigital Library
- DeFouw et al 98.Greg DeFouw, David Grove, and Craig Chambers. Fast Interprocedural Class Analysis. In Conference Record of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 222-236, January 1998.]] Google ScholarDigital Library
- Diwan et al 96.Amer Diwan, Eliot Moss, and Kathryn McKinley. Simple and Effective Analysis of Statically-typed Object-Oriented Programs. In Proceedings of the 1996 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP96}.]] Google ScholarDigital Library
- Dolby & Chien 98.Julian Dolby and Andrew Chien. An Evaluation of Automatic Object Inline Allocation Techniques. In Proceedings of the 1998 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Vancouver, Canada, October 1998.]] Google ScholarDigital Library
- Dolby & Chien 00.Julian Dolby and Andrew A. Chien. An Automatic Object Inlining Optimization and its Evaluation. In Proceedings of the ACM SIGPLAN '00 Conference on Programming Language Design and Implementation {PLD00}.]] Google ScholarDigital Library
- Dolby 97.Julian Dolby. Automatic Inline Allocation of Objects. In Proceedings of the ACM SIGPLAN '97 Conference on Programming Language Design and Implementation, pages 7-17, June 1997.]] Google ScholarDigital Library
- Fernandez 95.Mary F. Fernandez. Simple and Effective Link-Time Optimization of Modula-3 Programs. In Proceedings of the ACM SIGPLAN '95 Conference on Programming Language Design and Implementation, pages 103-115, June 1995.]] Google ScholarDigital Library
- Gay & Steensgaard 00.David Gay and Bjarne Steensgaard. Fast Escape Analysis and Stack Allocation for Object-Based Programs. In Proceedings of the 2000 International Conference on Compiler Construction, pages 82-93. Springer-Verlag, April 2000.]] Google ScholarDigital Library
- Gosling et al 96.James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, Reading, MA, 1996.]] Google ScholarDigital Library
- Grant et al 97.Brian Grant, Markus Mock, Matthai Philipose, Craig Chambers, and Susan Eggers. Annotation-Directed Run-Time Specialization in C. In Proceedings of the 1997 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 163-178, Amsterdam, the Netherlands, June 1997.]] Google ScholarDigital Library
- Grant et al 99.Brian Grant, Matthai Philipose, Markus Mock, Craig Chambers, and Susan Eggers. An Evaluation of Staged Run-Time Optimizations in DyC. In Proceedings of the ACM SIGPLAN '99 Conference on Programming Language Design and Implementation, May 1999.]] Google ScholarDigital Library
- Grant et al 00a.B. Grant, M. Mock, M. Philipose, C. Chambers, and S.J. Eggers. DyC: An Expressive Annotation-Directed Dynamic Compiler for C. Theoretical Computer Science, 248(1-2):147-199, October 2000.]] Google ScholarDigital Library
- Grant et al 00b.Brian Grant, Markus Mock, Matthai Philipose, Craig Chambers, and Susan J. Eggers. The Benefits and Costs of DyC's Run-Time Optimizations. ACM Transactions on Programming Languages and Systems, 22(5), 2000.]] Google ScholarDigital Library
- Grove & Chambers.David Grove and Craig Chambers. An Assessment of Call Graph Construction Algorithms. ACM Transactions on Programming Languages and Systems. To appear.]] Google ScholarDigital Library
- Grove et al 97.David Grove, Greg DeFouw, Jeffrey Dean, and Craig Chambers. Call Graph Construction in Object Oriented Languages. In Proceedings of the 1997 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Atlanta, GA, October 1997.]] Google ScholarDigital Library
- Jones et al 93.Neil D. Jones, Carstein K. Gomarde, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, New York, NY, 1993.]] Google ScholarDigital Library
- Lindholm & Yellin 97.Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, Reading, MA, 1997.]] Google ScholarDigital Library
- Mock et al 99.M. Mock, M. Berryman, C. Chambers, and S.J. Eggers. Calpa: ATool for Automating Dynamic Compilation. In 2nd Workshop on Feedback-Directed Optimization, November 1999.]]Google Scholar
- Mock et al 00.Markus Mock, Craig Chambers, and Susan J. Eggers. Calpa: A Tool for Automating Selective Dynamic Compilation. In Proceedings of the 33rd Annual International Symposium on Microarchitecture, Monterey, CA, December 2000.]] Google ScholarDigital Library
- OOP96.Proceedings of the 1996 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, San Jose, CA, October 1996.]]Google Scholar
- OOP99.Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Denver, CO, November 1999.]]Google Scholar
- OOP00.Proceedings of the 2000 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Minneapolis, MN, October 2000.]]Google Scholar
- OOP01.Proceedings of the 2001 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Tampa, FL, October 2001.]]Google Scholar
- Pechtchanski & Sarkar 01.Igor Pechtchanski and Vivek Sarkar. Dynamic Optimistic Interprocedural Analysis: A Framework and an Application. In Proceedings of the 2001 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP01}.]] Google ScholarDigital Library
- Philipose et al 02.Matthai Philipose, Craig Chambers, and Susan Eggers. Towards Automatic Construction of Staged Compilers. In Conference Record of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 2002.]] Google ScholarDigital Library
- PLD00.Proceedings of the ACM SIGPLAN '00 Conference on Programming Language Design and Implementation, May 2000.]]Google Scholar
- Ruf 00.Erik Ruf. Effective Synchronization Removal for Java. In Proceedings of the ACM SIGPLAN '00 Conference on Programming Language Design and Implementation {PLD00}.]] Google ScholarDigital Library
- Sodani & Sohi 98.A. Sodani and G.S. Sohi. An Empirical Analysis of Instruction Reuse. In Proceedings of the Eighth International Conference on Architectural Support for Programming Languages and Operating Systems, pages 35-45, October 1998.]] Google ScholarDigital Library
- Suganuma et al 01.Toshio Suganuma, Toshiaki Yasue, Motohiro Kawahito, Hideaki Komatsu, and Toshio Nakatani. A Dynamic Optimization Framework for a Java Just-In-Time Compiler. In Proceedings of the 2001 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP01}.]] Google ScholarDigital Library
- Sundaresan et al 00.Vijay Sundaresan, Laurie Hendren, Chrislain Razafimahefa, Raja Vallee-Rai, Patrick Lam, Etienne Gagnon, and Charles Godin. Practical Virtual Method Call Resolution for Java. In Proceedings of the 2000 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP00}.]] Google ScholarDigital Library
- Tip & Palsberg 00.Frank Tip and Jens Palsberg. Scalable Propagation-Based Call Graph Construction Algorithms. In Proceedings of the 2000 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP00}.]] Google ScholarDigital Library
- Whaley & Rinard 99.John Whaley and Martin Rinard. Compositional Pointer and Escape Analysis for Java Programs. In Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP99}.]] Google ScholarDigital Library
- Whaley 01.John Whaley. Partial Method Compilation using Dynamic Profile Information. In Proceedings of the 2001 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications {OOP01}.]] Google ScholarDigital Library
- Staged compilation
Recommendations
Staged compilation with two-level type theory
The aim of staged compilation is to enable metaprogramming in a way such that we have guarantees about the well-formedness of code output, and we can also mix together object-level and meta-level code in a concise and convenient manner. In this ...
Staged compilation
Traditional compilers compile and optimize files separately, making worst-case assumptions about the program context in which a file is to be linked. More aggressive compilation architectures perform cross-file interprocedural or whole-program analyses, ...
Comments