Dynamic Optimization through the use of Automatic Runtime Specialization

Profile-driven optimizations and dynamic optimization through specialization have taken optimizations to a new level. By using actual run-time data, optimizers can generate code that is specially tuned for the task at hand. However, most existing compilers that perform these optimizations require separate test runs to gather profile information, and/or user annotations in the code. In this thesis, I describe run-time optimizations that a dynamic compiler can perform automatically — without user annotations — by utilizing real-time performance data. I describe the implementation of the dynamic optimizations in the framework of a Java Virtual Machine and give performance results. Thesis Supervisor: Martin Rinard Title: Assistant Professor

[1]  Calton Pu,et al.  Threads and input/output in the synthesis kernal , 1989, SOSP '89.

[2]  John H. Hartman,et al.  Toba: Java for Applications - A Way Ahead of Time (WAT) Compiler , 1997, COOTS.

[3]  Robert G. Burger,et al.  Efficient compilation and profile-driven dynamic recompilation in scheme , 1997 .

[4]  Scott A. Mahlke,et al.  Using profile information to assist classic code optimizations , 1991, Softw. Pract. Exp..

[5]  Peter Sestoft,et al.  An experiment in partial evaluation: the generation of a compiler generator , 1985, SIGP.

[6]  Olivier Danvy,et al.  Static and dynamic semantics processing , 1991, POPL '91.

[7]  M. Anton Ertl Implementation of Stack-Based Languages on Register Machines , 1996 .

[8]  Calton Pu,et al.  Quaject composition in the Synthesis kernel , 1991, Proceedings 1991 International Workshop on Object Orientation in Operating Systems.

[9]  John C. Gyllenhaal,et al.  Optimizing NET Compilers for Improved Java Performance , 1997, Computer.

[10]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[11]  James R. Larus,et al.  Efficient path profiling , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[12]  Burzin A. Patel,et al.  Using branch handling hardware to support profile-driven optimization , 1994, Proceedings of MICRO-27. The 27th Annual IEEE/ACM International Symposium on Microarchitecture.

[13]  Jong-Deok Choi,et al.  Efficient and precise modeling of exceptions for the analysis of Java programs , 1999, PASTE '99.

[14]  Peter Lee,et al.  Dynamic specialization in the Fabius system , 1998, CSUR.

[15]  Siau-Cheng Khoo,et al.  Compiling Inheritance using Partial Evaluation , 1991, PEPM.

[16]  Peter Lee,et al.  Lightweight Run-Time Code Generation , 1994, PEPM.

[17]  Roland H. C. Yap,et al.  An Optimizing Compiler for CLP(R) , 1995, CP.

[18]  Olivier Danvy,et al.  Semantics-Directed Compilation of Nonlinear Patterns , 1991, Inf. Process. Lett..

[19]  Dawson R. Engler,et al.  DPF: fast, flexible message demultiplexing using dynamic code generation , 1996, SIGCOMM 1996.

[20]  Joseph A. Fisher,et al.  Trace Scheduling: A Technique for Global Microcode Compaction , 1981, IEEE Transactions on Computers.

[21]  David Grove,et al.  Call graph construction in object-oriented languages , 1997, OOPSLA '97.

[22]  Jacques Noyé,et al.  A Uniform Approach for Compile-Time and Run-Time Specialization , 1996, Dagstuhl Seminar on Partial Evaluation.

[23]  Michael Wolfe,et al.  Initial Results for Glacial Variable Analysis , 1996, LCPC.

[24]  Christopher W. Fraser,et al.  BURG: fast optimal instruction selection and tree parsing , 1992, SIGP.

[25]  Wei Li,et al.  Optimizing Java bytecodes , 1997 .

[26]  Craig Chambers,et al.  Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches , 1991, ECOOP.

[27]  Ron Cytron,et al.  Efficiently computing Φ-nodes on-the-fly , 1993, TOPL.

[28]  Jack Trout,et al.  The Power Of Simplicity , 1998 .

[29]  Calton Pu,et al.  A Lock-Free Multiprocessor OS Kernel , 1992, OPSR.

[30]  Peter Lee,et al.  Optimizing ML with run-time code generation , 1996, PLDI '96.

[31]  Thomas M. Conte,et al.  The Effect of Code Expanding Optimizations on Instruction Cache Design , 1993, IEEE Trans. Computers.

[32]  Thomas M. Conte,et al.  Commercializing profile-driven optimization , 1995, Proceedings of the Twenty-Eighth Annual Hawaii International Conference on System Sciences.

[33]  Geoffrey L. Burn,et al.  The Abstract Interpretation of Functional Languages , 1994, Theory and Formal Methods.

[34]  Gilles Muller,et al.  Scaling up partial evaluation for optimizing the Sun commercial RPC protocol , 1997 .

[35]  Craig Chambers,et al.  Whole-program optimization of object-oriented languages , 1996 .

[36]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[37]  Craig Chambers,et al.  An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes , 1991 .

[38]  Charles Consel,et al.  Harissa: A Flexible and Efficient Java Environment Mixing Bytecode and Compiled Code , 1997, COOTS.

[39]  Andreas Krall,et al.  CACAO - A 64-bit JavaVM Just-in-Time Compiler , 1997, Concurr. Pract. Exp..

[40]  Ulrik Pagh Schultz,et al.  Harissa: A Hybrid Approach to Java Execution , 1999, IEEE Softw..

[41]  James R. Larus,et al.  Exploiting hardware performance counters with flow and context sensitive profiling , 1997, PLDI '97.

[42]  Henry Massalin Calton Pu Reimplementing the Synthesis Kernel on the Sony NeWS Workstation , 1992 .

[43]  RinardMartin,et al.  Compositional pointer and escape analysis for Java programs , 1999 .

[44]  Vivek Sarkar,et al.  The Jalape ~ no Dynamic Optimizing Compiler for Java TM , 1999 .

[45]  Alan Dain Samples,et al.  Profile-Driven Compilation , 1991 .

[46]  Dawson R. Engler,et al.  DPF: Fast, Flexible Message Demultiplexing Using Dynamic Code Generation , 1996, SIGCOMM.

[47]  J. Dean,et al.  Training Compilers to Make Better Inlining Decisions , 1993 .

[48]  Jason R. C. Patterson,et al.  Accurate static branch prediction by value range propagation , 1995, PLDI '95.

[49]  Mark N. Wegman,et al.  An efficient method of computing static single assignment form , 1989, POPL '89.

[50]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[51]  Troy Downing,et al.  Java Virtual Machine , 1997 .

[52]  William Pugh,et al.  Partial evaluation of high-level imperative programming languages with applications in hard real-time systems , 1992, POPL '92.

[53]  David Grove,et al.  Identifying Profitable Specialization in Object-Oriented Languages , 1994, PEPM.

[54]  Thomas M. Conte,et al.  Accurate and practical profile-driven compilation using the profile buffer , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[55]  Peter Holst Andersen Partial Evaluation Applied to Ray Tracing , 1996 .

[56]  Karl Pettis,et al.  Profile guided code positioning , 1990, PLDI '90.

[57]  David Grove,et al.  Selective specialization for object-oriented languages , 1995, PLDI '95.

[58]  Mark Leone,et al.  Dynamo: A Staged Compiler Architecture for Dynamic Program Optimization , 1997 .

[59]  David Grove,et al.  A Framework for Selective Recompilation in the Presence of Complex Intermodule Dependencies , 1995, 1995 17th International Conference on Software Engineering.

[60]  Donald A. Smith,et al.  Toward the partial evaluation of CLP languages , 1991 .

[61]  Donald A. Smith,et al.  Toward the partial evaluation of CLP languages , 1991, PEPM '91.

[62]  Scott A. Mahlke,et al.  Using Profile Information to Assist Advaced Compiler Optimization and Scheduling , 1992, LCPC.

[63]  Dawson R. Engler,et al.  tcc: a system for fast, flexible, and high-level dynamic code generation , 1997, PLDI '97.

[64]  David Grove,et al.  Frameworks for Intra- and Interprocedural Dataflow Analysis , 1998 .

[65]  Michael A. Harrison,et al.  Accurate static estimators for program optimization , 1994, PLDI '94.

[66]  Calton Pu,et al.  The Synthesis Kernel , 1988, Comput. Syst..

[67]  A. Dain Samples Compiler Implementation of ADTs Using Profile Data , 1992, CC.

[68]  Dawson R. Engler,et al.  VCODE: a retargetable, extensible, very fast dynamic code generation system , 1996, PLDI '96.

[69]  Lars Clausen A Java bytecode optimizer using side‐effect analysis , 1997 .

[70]  Erik R. Altman,et al.  A JAVA ILP Machine Based on Fast Dynamic Compilation , 1997 .

[71]  David Grove,et al.  Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis , 1995, ECOOP.

[72]  Vivek Sarkar,et al.  Jalape~ No | a Compiler-supported Java Tm Virtual Machine for Servers , 1999 .

[73]  Mark N. Wegman,et al.  Efficiently computing static single assignment form and the control dependence graph , 1991, TOPL.

[74]  Craig Chambers,et al.  The design and implementation of the self compiler, an optimizing compiler for object-oriented programming languages , 1992 .

[75]  R. Kent Dybvig,et al.  An infrastructure for profile-driven dynamic recompilation , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[76]  David Detlefs,et al.  Garbage collection and local variable type-precision and liveness in Java virtual machines , 1998, PLDI.

[77]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[78]  M. Anton Ertl Optimal code selection in DAGs , 1999, POPL '99.

[79]  Ole Agesen Design and Implementation of Pep, A Java Just-in-Time Translator , 1997, Theory Pract. Object Syst..

[80]  Calton Pu,et al.  Fine-Grain Adaptive Scheduling using Feedback , 1989, Comput. Syst..

[81]  Ali-Reza Adl-Tabatabai,et al.  Fast, effective code generation in a just-in-time Java compiler , 1998, PLDI.

[82]  Erik Sandewall,et al.  A Partial Evaluator, and its Use as a Programming Tool , 1976, Artif. Intell..

[83]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[84]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[85]  Randall R. Heisch Trace-directed program restructuring for AIX executables , 1994, IBM J. Res. Dev..

[86]  Hubertus Franke,et al.  An Efficient Implementation of MPI , 1994 .

[87]  M. Anton Ertl A New Approach to Forth Native Code Generation , 1992 .

[88]  Gilles Muller,et al.  Scaling up partial evaluation for optimizing the Sun commercial RPC protocol , 1997, PEPM.

[89]  Olivier Danvy,et al.  Partial Evaluation of Pattern Matching in Strings , 1989, Inf. Process. Lett..

[90]  David Grove,et al.  Profile-guided receiver class prediction , 1995, OOPSLA.

[91]  Vivek Sarkar,et al.  Linear scan register allocation , 1999, TOPL.

[92]  Neil D. Jones,et al.  Mix: A self-applicable partial evaluator for experiments in compiler generation , 1989, LISP Symb. Comput..

[93]  Margaret Montenyohl,et al.  Towards Efficient Compilation of a Dynamic Object-Oriented Language , 1992, PEPM.

[94]  Dawson R. Engler,et al.  DCG: an efficient, retargetable dynamic code generation system , 1994, ASPLOS VI.

[95]  David P. Howell,et al.  Commercializing Pro le-Driven Optimization , 1995 .

[96]  Michal Cierniak,et al.  Briki: A Flexible Java Compiler , 1996 .

[97]  Lars Ræder Clausen A Java Bytecode Optimizer Using Side-Effect Analysis , 1997, Concurr. Pract. Exp..

[98]  Thomas M. Conte,et al.  Hardware-Based Pro ling: An E ective Technique for Pro le-Driven Optimization , 1996 .

[99]  Urs Hölzle,et al.  Type feedback vs. concrete type inference: a comparison of optimization techniques for object-oriented languages , 1995, OOPSLA.

[100]  Markus Mock,et al.  DyC: an expressive annotation-directed dynamic compiler for C , 2000, Theor. Comput. Sci..

[101]  Daniel Weise,et al.  Automatic generation of compiled simulations through program specialization , 1991, 28th ACM/IEEE Design Automation Conference.

[102]  Jesper Jørgensen,et al.  Generating a Pattern Matching Compiler by Partial Evaluation , 1990, Functional Programming.

[103]  Henry Massalin,et al.  Synthesis: an efficient implementation of fundamental operating system services , 1992 .

[104]  Craig Chambers,et al.  Towards better inlining decisions using inlining trials , 1994, LFP '94.

[105]  Urs Hölzle,et al.  Dynamic versus Static Optimization Techniques for Object-Oriented Languages , 1995, Theory Pract. Object Syst..

[106]  Jens Palsberg,et al.  Type inference of SELF: Analysis of objects with dynamic and multiple inheritance , 1995, Softw. Pract. Exp..

[107]  John C. Gyllenhaal,et al.  Java bytecode to native code translation: the Caffeine prototype and preliminary results , 1996, Proceedings of the 29th Annual IEEE/ACM International Symposium on Microarchitecture. MICRO 29.

[108]  Peter Lee,et al.  Deferred Compilation: The Automation of Run-Time Code Generation , 1993 .

[109]  W. W. Hwu,et al.  Achieving high instruction cache performance with an optimizing compiler , 1989, ISCA '89.

[110]  Calton Pu,et al.  An Overview of the Synthesis Operating System , 1989 .

[111]  P. Crégut Machines a environnement pour la reduction symbolique et l'evaluation partielle , 1991 .

[112]  Andrew A. Berlin,et al.  Partial evaluation applied to numerical computation , 1990, LISP and Functional Programming.

[113]  Luddy Harrison,et al.  Can Abstract Interpretation Become a Mainstream Compiler Technology? (Abstract) , 1997, SAS.

[114]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[115]  Martin C. Rinard,et al.  Compositional pointer and escape analysis for Java programs , 1999, OOPSLA '99.

[116]  Siau-Cheng Khoo,et al.  Semantics-Directed Generation of a Prolog Compiler , 1991, Sci. Comput. Program..

[117]  Vivek Sarkar,et al.  Dependence Analysis for Java , 1999, LCPC.

[118]  Scott A. Mahlke,et al.  Profile‐guided automatic inline expansion for C programs , 1992, Softw. Pract. Exp..

[119]  Guang R. Gao,et al.  A linear time algorithm for placing φ-nodes , 1995, POPL '95.