Escape analysis for object-oriented languages: application to Java

Escape analysis [27, 14, 5] is a static analysis that determines whether the lifetime of data exceeds its static scope. The main originality of our escape analysis is that it determines precisely the effect of assignments, which is necessary to apply it to object oriented languages with promising results, whereas previous work [27, 14, 5] applied it to functional languages and were very imprecise on assignments. Our implementation analyses the full Java#8482; Language. We have applied our analysis to stack allocation and synchronization elimination. We manage to stack allocate 13% to 95% of data, eliminate more than 20% of synchronizations on most programs (94% and 99% on two examples) and get up to 44% speedup (21% on average). Our detailed experimental study on large programs shows that the improvement comes from the decrease of the garbage collection and allocation times than from improvements on data locality [7], contrary to what happened for ML [5].

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

[2]  Markus Mohnen Efficient Compile-Time Garbage Collection for Arbitrary Data Structures , 1995, PLILP.

[3]  Markus Mohnen,et al.  Efficient Closure Utilisation by Higher-Order Inheritance Analysis , 1995, SAS.

[4]  Emin Gün Sirer,et al.  Static Analyses for Eliminating Unnecessary Synchronization from Java Programs , 1999, SAS.

[5]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.

[6]  Mads Tofte,et al.  A theory of stack allocation in polymorphically typed languages , 1993 .

[7]  Neil D. Jones,et al.  A flexible approach to interprocedural data flow analysis and programs with recursive data structures , 1982, POPL '82.

[8]  Paul Hudak A semantic model of reference counting and its abstraction (detailed summary) , 1986, LFP '86.

[9]  Williams Ludwell Harrison,et al.  The interprocedural analysis and automatic parallelization of Scheme programs , 1990, LISP Symb. Comput..

[10]  Williams Ludwell HarrisonIII The interprocedural analysis and automatic parallelization of Scheme programs , 1989 .

[11]  Chau-Wen Tseng,et al.  Compiler optimizations for improving data locality , 1994, ASPLOS VI.

[12]  Bruno Blanchet,et al.  Escape analysis: correctness proof, implementation and experimental results , 1998, POPL '98.

[13]  Alain Deutsch,et al.  Interprocedural may-alias analysis for pointers: beyond k-limiting , 1994, PLDI '94.

[14]  Thomas P. Murtagh,et al.  Lifetime analysis of dynamically allocated objects , 1988, POPL '88.

[15]  David R. Chase,et al.  Safety consideration for storage allocation optimizations , 1988, PLDI '88.

[16]  Katsuro Inoue,et al.  Analysis of functional programs to detect run-time garbage cells , 1988, TOPL.

[17]  Lars Birkedal,et al.  From region inference to von Neumann machines via region representation inference , 1996, POPL '96.

[18]  Urs Hölzle,et al.  Removing unnecessary synchronization in Java , 1999, OOPSLA '99.

[19]  Alain Deutsch,et al.  On the complexity of escape analysis , 1997, POPL '97.

[20]  Benjamin Goldberg,et al.  Escape analysis on lists , 1992, PLDI '92.

[21]  Bjarne Steensgaard Stack Allocating Objects in Java , 1998 .

[22]  Alexander Aiken,et al.  Better static memory management: improving region-based analysis of higher-order languages , 1995, PLDI '95.

[23]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[24]  John Hannan A Type-based Analysis for Stack Allocation in Functional Languages , 1995, SAS.

[25]  Charles E. McDowell,et al.  Reducing garbage in Java , 1998, SIGP.

[26]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[27]  Alain Deutsch,et al.  On determining lifetime and aliasing of dynamically allocated data in higher-order functional specifications , 1989, POPL '90.

[28]  Marc Feeley,et al.  Storage use analysis and its applications , 1996, ICFP '96.

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

[30]  Lucy Hederman Compile time garbage collection using reference count analysis , 1989 .

[31]  Simon Hughes,et al.  Compile-Time Garbage Collection for Higher-Order Functional Languages , 1992, J. Log. Comput..