Inferring aliasing and encapsulation properties for java

There are many proposals for language techniques to control aliasing and encapsulation in object oriented programs, typically based on notions of object ownership and pointer uniqueness. Most of these systems require extensive manual annotations, and thus there is little experience with these properties in large, existing Java code bases. To remedy this situation, we present Uno, a novel static analysis for automatically inferring ownership, uniqueness, and other aliasing and encapsulation properties in Java. Our analysis requires no annotations, and combines an intraprocedural points-to analysis with an interprocedural, demand-driven predicate resolution algorithm. We have applied Uno to a variety of Java applications and found that some aliasing properties, such as temporarily lending a reference to a method, are common, while others, in particular field and argument ownership, are relatively uncommon. As a result, we believe that Uno can be a valuable tool for discovering and understanding aliasing and encapsulation in Java programs.

[1]  Barbara G. Ryder,et al.  A safe approximate algorithm for interprocedural aliasing , 1992, PLDI '92.

[2]  Martin C. Rinard,et al.  Pointer and escape analysis for multithreaded programs , 2001, PPoPP '01.

[3]  Manuvir Das,et al.  Unification-based pointer analysis with directional assignments , 2000, PLDI '00.

[4]  Donglin Liang,et al.  Efficient Computation of Parameterized Pointer Information for Interprocedural Analyses , 2001, SAS.

[5]  Paulo Sérgio Almeida Balloon Types: Controlling Sharing of State in Data Types , 1997, ECOOP.

[6]  Liuba Shrira,et al.  Ownership types for object encapsulation , 2003, POPL '03.

[7]  John Hogg,et al.  Islands: aliasing protection in object-oriented languages , 1991, OOPSLA '91.

[8]  John Tang Boyland,et al.  Alias burying: Unique variables without destructive reads , 2001, Softw. Pract. Exp..

[9]  Ondrej Lhoták,et al.  Jedd: a BDD-based relational extension of Java , 2004, PLDI '04.

[10]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[11]  Barbara G. Ryder,et al.  Points-to and Side-Effect Analyses for Programs Built with Precompiled Libraries , 2001, CC.

[12]  Sigmund Cherem,et al.  A Practical Escape and Effect Analysis for Building Lightweight Method Summaries , 2007, CC.

[13]  Jan Vitek,et al.  Flexible Alias Protection , 1998, ECOOP.

[14]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[15]  Philip Wadler,et al.  Once upon a type , 1995, FPCA '95.

[16]  Yin Liu,et al.  Ownership and Immutability Inference for UML-Based Object Access Control , 2007, 29th International Conference on Software Engineering (ICSE'07).

[17]  John Tang Boyland,et al.  Connecting effects and uniqueness with adoption , 2005, POPL '05.

[18]  Monica S. Lam,et al.  Static detection of leaks in polymorphic containers , 2006, ICSE '06.

[19]  Jens Palsberg,et al.  Encapsulating objects with confined types , 2001, TOPL.

[20]  James Noble,et al.  Ownership types for flexible alias protection , 1998, OOPSLA '98.

[21]  Sigmund Cherem,et al.  Uniqueness inference for compile-time object deallocation , 2007, ISMM '07.

[22]  Alexander Aiken,et al.  Checking and inferring local non-aliasing , 2003, PLDI '03.

[23]  Sophia Drossopoulou,et al.  Ownership, encapsulation and the disjointness of type and effect , 2002, OOPSLA '02.

[24]  Monica S. Lam,et al.  Cloning-based context-sensitive pointer alias analysis using binary decision diagrams , 2004, PLDI '04.

[25]  Ken Arnold,et al.  The Java Programming Language , 1996 .

[26]  Ken Arnold,et al.  Java(TM) Programming Language, The (4th Edition) , 2005 .

[27]  Manu Sridharan,et al.  Refinement-based context-sensitive points-to analysis for Java , 2006, PLDI '06.

[28]  Benjamin Livshits,et al.  Reflection Analysis for Java , 2005, APLAS.

[29]  David Walker,et al.  Alias Types for Recursive Data Structures , 2000, Types in Compilation.

[30]  Craig Chambers,et al.  Alias annotations for program understanding , 2002, OOPSLA '02.

[31]  Jan Vitek,et al.  Confined types in Java , 2001, Softw. Pract. Exp..

[32]  Laurie J. Hendren,et al.  Context-sensitive interprocedural points-to analysis in the presence of function pointers , 1994, PLDI '94.