Runtime specialization with optimistic heap analysis

We describe a highly practical program specializer for Java programs. The specializer is powerful, because it specializes optimistically, using (potentially transient) constants in the heap; it is precise, because it specializes using data structures that are only partially invariant; it is deployable, because it is hidden in a JIT compiler and does not require any user annotations or offline preprocessing; it is simple, because it uses existing JIT compiler ingredients; and it is fast, because it specializes programs in under 1s.These properties are the result of (1) a new algorithm for selecting specializable code fragments, based on a notion of influence; (2) a precise store profile for identifying constant heap locations; and (3) an efficient invalidation mechanism for monitoring optimistic assumptions about heap constants. Our implementation of the specializer in the Jikes RVM has low overhead, selects specialization points that would be chosen manually, and produces speedups ranging from a factor of 1.2 to 6.4, comparable with annotation-guided specializers.

[1]  Erik Ruf,et al.  Opportunities for Online Partial Evaluation , 1992 .

[2]  Lars Ole Andersen,et al.  Program Analysis and Specialization for the C Programming Language , 2005 .

[3]  Matthew Arnold,et al.  Thin Guards: A Simple and Effective Technique for Reducing the Penalty of Dynamic Class Loading , 2002, ECOOP.

[4]  Markus Mock,et al.  A retrospective on: "an evaluation of staged run-time optimizations in DyC" , 2004, SIGP.

[5]  Markus Mock,et al.  The benefits and costs of DyC's run-time optimizations , 2000, TOPL.

[6]  Charles Consel,et al.  A general approach for run-time specialization and its application to C , 1996, POPL '96.

[7]  Stephen J. Fink,et al.  The Jalapeño virtual machine , 2000, IBM Syst. J..

[8]  Robert E. Tarjan,et al.  Fast Algorithms for Solving Path Problems , 1981, JACM.

[9]  John Cocke,et al.  A program data flow analysis procedure , 1976, CACM.

[10]  Frank Tip,et al.  A survey of program slicing techniques , 1994, J. Program. Lang..

[11]  Ulrik Pagh Schultz,et al.  Specialization patterns , 2000, Proceedings ASE 2000. Fifteenth IEEE International Conference on Automated Software Engineering.

[12]  Matthew Arnold,et al.  Online feedback-directed optimization of Java , 2002, OOPSLA '02.

[13]  Matthew Arnold,et al.  A framework for reducing the cost of instrumented code , 2001, PLDI '01.

[14]  Gurindar S. Sohi,et al.  A programmable co-processor for profiling , 2001, Proceedings HPCA Seventh International Symposium on High-Performance Computer Architecture.

[15]  James E. Smith,et al.  Rapid profiling via stratified sampling , 2001, ISCA 2001.

[16]  Calton Pu,et al.  Optimistic incremental specialization: streamlining a commercial operating system , 1995, SOSP.

[17]  Xiangyu Zhang,et al.  Cost effective dynamic program slicing , 2004, PLDI '04.

[18]  Craig Chambers,et al.  Making pure object-oriented languages practical , 1991, OOPSLA 1991.

[19]  Richard Johnson,et al.  The Transmeta Code Morphing/spl trade/ Software: using speculation, recovery, and adaptive retranslation to address real-life challenges , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[20]  Toshiaki Yasue,et al.  A dynamic optimization framework for a Java just-in-time compiler , 2001, OOPSLA '01.

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

[22]  Ulrik Pagh Schultz,et al.  Towards Automatic Specialization of Java Programs , 1999, ECOOP.

[23]  Derek Bruening,et al.  An infrastructure for adaptive dynamic optimization , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[24]  Saman Amarasinghe,et al.  Dynamic native optimization of interpreters , 2003, IVME '03.

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

[26]  Sudheendra Hangal,et al.  Tracking down software bugs using automatic anomaly detection , 2002, ICSE '02.

[27]  Saumya K. Debray,et al.  Code Specialization Based on Value Profiles , 2000, SAS.

[28]  Markus Mock,et al.  Annotation-directed run-time specialization in C , 1997 .

[29]  Brad Calder,et al.  Value profiling , 1997, Proceedings of 30th Annual International Symposium on Microarchitecture.

[30]  Erik Ruf,et al.  Data specialization , 1996, PLDI '96.

[31]  G. Ramalingam Data flow frequency analysis , 1996, PLDI '96.

[32]  Weifeng Zhang,et al.  An event-driven multithreaded dynamic optimization framework , 2005, 14th International Conference on Parallel Architectures and Compilation Techniques (PACT'05).

[33]  Erik Ruf Topics in online partial evaluation , 1993 .

[34]  James E. Smith,et al.  Concurrent garbage collection using hardware-assisted profiling , 2000, ISMM '00.

[35]  Markus Mock,et al.  Calpa: a tool for automating selective dynamic compilation , 2000, MICRO 33.

[36]  W. E. Weihl,et al.  Efficient and flexible value sampling , 2000, SIGP.

[37]  Mikko H. Lipasti,et al.  Silent stores for free , 2000, MICRO 33.

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

[39]  Janusz W. Laski,et al.  Dynamic Program Slicing , 1988, Inf. Process. Lett..

[40]  James E. Smith,et al.  Techniques for transparent program specialization in dynamic optimizers , 2003 .

[41]  Barbara G. Ryder,et al.  Interprocedural modification side effect analysis with pointer aliasing , 1993, PLDI '93.

[42]  Stephen J. Fink,et al.  Design, implementation and evaluation of adaptive recompilation with on-stack replacement , 2003, International Symposium on Code Generation and Optimization, 2003. CGO 2003..

[43]  Dawson R. Engler,et al.  C: a language for high-level, efficient, and machine-independent dynamic code generation , 1995, POPL '96.

[44]  Krste Asanovic,et al.  Mondrian memory protection , 2002, ASPLOS X.

[45]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[46]  Brian N. Bershad,et al.  Fast, effective dynamic compilation , 1996, PLDI '96.

[47]  Matthew Arnold,et al.  Adaptive optimization in the Jalapeño JVM , 2000, OOPSLA '00.