skip to main content
10.1145/503032.503045acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
Article

Staged compilation

Published:14 January 2002Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. Gosling et al 96.James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, Reading, MA, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. Grove & Chambers.David Grove and Craig Chambers. An Assessment of Call Graph Construction Algorithms. ACM Transactions on Programming Languages and Systems. To appear.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. Lindholm & Yellin 97.Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, Reading, MA, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle Scholar
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. OOP96.Proceedings of the 1996 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, San Jose, CA, October 1996.]]Google ScholarGoogle Scholar
  30. OOP99.Proceedings of the 1999 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Denver, CO, November 1999.]]Google ScholarGoogle Scholar
  31. OOP00.Proceedings of the 2000 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Minneapolis, MN, October 2000.]]Google ScholarGoogle Scholar
  32. OOP01.Proceedings of the 2001 ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, Tampa, FL, October 2001.]]Google ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. PLD00.Proceedings of the ACM SIGPLAN '00 Conference on Programming Language Design and Implementation, May 2000.]]Google ScholarGoogle Scholar
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  1. Staged compilation

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      PEPM '02: Proceedings of the 2002 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
      January 2002
      146 pages
      ISBN:158113455X
      DOI:10.1145/503032

      Copyright © 2002 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 14 January 2002

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      PEPM '02 Paper Acceptance Rate11of22submissions,50%Overall Acceptance Rate66of120submissions,55%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader