Field analysis: getting useful and low-cost interprocedural information

We present a new limited form of interprocedural analysis called field analysis that can be used by a compiler to reduce the costs of modern language features such as object-oriented programming,automatic memory management, and run-time checks required for type safety.Unlike many previous interprocedural analyses, our analysis is cheap, and does not require access to the entire program. Field analysis exploits the declared access restrictions placed on fields in a modular language (e.g. field access modifiers in Java) in order to determine useful properties of fields of an object. We describe our implementation of field analysis in the Swiftoptimizing compiler for Java, as well a set of optimizations thatexploit the results of field analysis. These optimizations include removal of run-time tests, compile-time resolution of method calls, object inlining, removal of unnecessary synchronization, and stack allocation. Our results demonstrate that field analysis is efficient and effective. Speedups average 7% on a wide range of applications, with some times reduced by up to 27%. Compile time overhead of field analysis is about 10%.

[1]  Amer Diwan,et al.  Type-based alias analysis , 1998, PLDI.

[2]  Andrew W. Appel,et al.  Unrolling lists , 1994, LFP '94.

[3]  Bruno Blanchet,et al.  Escape analysis for object-oriented languages: application to Java , 1999, OOPSLA '99.

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

[5]  Andrew A. Chien,et al.  An evaluation of automatic object inline allocation techniques , 1998, OOPSLA '98.

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

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

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

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

[10]  Robert E. Tarjan,et al.  A fast algorithm for finding dominators in a flowgraph , 1979, TOPL.

[11]  Erik Ruf Partitioning dataflow analyses using types , 1997, POPL '97.

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

[13]  Amer Diwan,et al.  Simple and effective analysis of statically-typed object-oriented programs , 1996, OOPSLA '96.

[14]  Keith H. Randall,et al.  The Swift Java Compiler: Design and Implementation , 2002 .

[15]  K. Rustan M. Leino,et al.  Extended static checking , 1998, PROCOMET.

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

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

[18]  J. Moss,et al.  Simple and E ective Analysis ofStatically-Typed Object-Oriented ProgramsAmer , 1996 .

[19]  David Detlefs,et al.  Inlining of Virtual Methods , 1999, ECOOP.

[20]  BlanchetBruno Escape analysis for object-oriented languages , 1999 .

[21]  Xavier Leroy,et al.  Unboxed objects and polymorphic typing , 1992, POPL '92.