skip to main content
article

Inferring aliasing and encapsulation properties for java

Published:21 October 2007Publication History
Skip Abstract Section

Abstract

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.

References

  1. A. Aiken, J. S. Foster, J. Kodumal, and T. Terauchi. Checking and Inferring Local Non-Aliasing. In PLDI'03, pages 129--140, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Aldrich, V. Kostadinov, and C. Chambers. Alias Annotations for Program Understanding. In OOPSLA'02, pages 311--330, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. P. S. Almeida. Balloon Types: Controlling Sharing of State in Data Types. In ECOOP'97, pages 32--59, 1997.Google ScholarGoogle Scholar
  4. K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language. Addison-Wesley, 3rd edition, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. M. Blackburn, R. Garner, C. Hoffman, et al. The DaCapo benchmarks: Java benchmarking development and analysis. In OOPSLA'06, pages 169--190, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Boyapati, B. Liskov, and L. Shrira. Ownership Types for Object Encapsulation. In POPL'03, pages 213--223, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Boyland. Alias burying: Unique variables without destructive reads. Software-Practice and Experience, 31(6):533--553, May 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. T. Boyland and W. Retert. Connecting effects and uniqueness with adoption. In POPL'05, pages 283--295, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Cherem and R. Rugina. A Practical Escape and Effect Analysis for Building Lightweight Method Summaries. In CC'07, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Cherem and R. Rugina. Uniqueness inference for compiletime object deallocation. In ISMM'07, 2007. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. G. Clarke and S. Drossopoulou. Ownership, Encapsulation and the Disjointness of Type and Effect. In OOPSLA'02, pages 292--310, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. G. Clarke, J. M. Potter, and J. Noble. Onwership Types for Flexible Alias Protection. In OOPSLA'98, pages 48--64, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Das. Unification-based Pointer Analysis with Directional Assignments. In PLDI'00, pages 35--46, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Emami, R. Ghiya, and L. J. Hendren. Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers. In PLDI'94, pages 242--256, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Fähndrich and R. DeLine. Adoption and Focus: Practical Linear Types for Imperative Programming. In PLDI'02, pages 13--24, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Grothoff, J. Palsberg, and J. Vitek. Encapsulating Objects with Confined Types. In OOPSLA'01, pages 241--253, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. L. Heine and M. S. Lam. Static Detection of Leaks in Polymorphic Containers. In ICSE'06, pages 252--261, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Hogg. Islands: Aliasing Protection In Object-Oriented Languages. In OOPSLA'91, pages 271--285, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. W. Landi and B. G. Ryder. A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. In PLDI'92, pages 235--248, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. O. Lhoták and L. J. Hendren. Jedd: A BDD--based relational extension of Java. In PLDI'04, pages 158--169, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Liang and M. J. Harrold. Efficient Computation of Parametrized Pointer Information for Interprocedural Analyses. In SAS'01, pages 279--298, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Y. Liu and A. Milanova. Ownership and Immutability Inference for UML-based Object Access Control. In ICSE'07, pages 323--332, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. V. B. Livshits, J. Whaley, and M. S. Lam. Reflection Analysis for Java. In APLAS'05, pages 139--160, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Noble, J. Vitek, and J. Potter. Flexible Alias Protection. In ECOOP'98, pages 158--185, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Rountev and B. G. Ryder. Points-to and Side-Effect Analyses for Programs Built with Precompiled Libraries. In CC'01, pages 20--36, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. A. Salcianu and M. C. Rinard. Pointer and escape analysis for multithreaded programs. In PPOPP'01, pages 12--23, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Sridharan and R. Bodik. Refinement-Based Context-Sensitive Points-To Analysis for Java. In PLDI'06, pages 387--400, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. N. Turner, P. Wadler, and C. Mossin. Once upon a type. In FPCA'95, pages 1--11, La Jolla, California, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. R. Vallée-Rai, P. Co, E. Gagnon, L. J. Hendren, P. Lam, and V. Sundaresan. Soot -a Java bytecode optimization framework. In CASCON'99, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. J. Vitek and B. Bokowski. Confined types in java. Software-Practice and Experience, 31(6):507--532, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Walker and G. Morrisett. Alias Types for Recursive Data Structures. In TIC'00, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. J. Whaley and M. S. Lam. Cloning-Based Context-Sensitive Pointer Alias Analysis Using Binary Decision Diagrams. In PLDI'04, pages 131--144, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Inferring aliasing and encapsulation properties for java

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!