skip to main content
10.1145/1094811.1094817acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Demand-driven points-to analysis for Java

Published:12 October 2005Publication History

ABSTRACT

We present a points-to analysis technique suitable for environments with small time and memory budgets, such as just-in-time (JIT) compilers and interactive development environments (IDEs). Our technique is demand-driven, performing only the work necessary to answer each query (a request for a variable's points-to information) issued by a client. In cases where even the demand-driven approach exceeds the time budget for a query, we employ early termination, i.e., stopping the analysis prematurely and returning an over-approximated result to the client. Our technique improves on previous demand-driven points-to analysis algorithms [17, 33] by achieving much higher precision under small time budgets and early termination.We formulate Andersen's analysis [5] for Java as a CFL-reachability problem [33]. This formulation shows that Andersen's analysis for Java is a balanced-parentheses problem, an insight that enables our new techniques. We exploit the balanced parentheses structure to approximate Andersen's analysis by regularizing the CFL-reachability problem, yielding an asymptotically cheaper algorithm. We also show how to regain most of the precision lost in the regular approximation as needed through refinement. Our evaluation shows that our regularization and refinement approach achieves nearly the precision of field-sensitive Andersen's analysis in time budgets as small as 2ms per query. Our technique can yield speedups of up to 16x over computing an exhaustive Andersen's analysis for some clients, with little to no precision loss.

References

  1. Ashes suite collection. http://www.sable.mcgill.ca/software/.Google ScholarGoogle Scholar
  2. jEdit: Open source programmer's text editor. http://www.jedit.org.Google ScholarGoogle Scholar
  3. A. Aiken, M. Fändrich, J. S. Foster, and Z. Su. A toolkit for constructing type- and constraint-based program analyses. In Workshop on Types in Compilation, Kyoto, Japan, March 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Alpern, D. Attanasio, J. Barton, M. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, T. Ngo, M. Mergen, V. Sarkar, M. Serrano, J. Shepherd, S. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeno virtual machine. IBM Systems Journal, Java Performance Issue, 39(1), 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, University of Copenhagen, DIKU, 1994.Google ScholarGoogle Scholar
  6. D. Bacon and P. Sweeney. Fast static analysis of c++ virtual function calls. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), San Jose, CA, October 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Berndl, O. Lhoták, F. Qian, L. Hendren, and N. Umanee. Points-to analysis using BDDs. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), San Diego, CA, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Chambers and D. Ungar. Making pure object-oriented languages practical. In N. Meyrowitz, editor, Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), volume 26, pages 1--15, New York, NY, 1991. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J.-D. Choi, M. Gupta, M. Serrano, V. Sreedhar, and S. Midkiff. Escape analysis for Java. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Denver, Colorado, November 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Das. Unification-based pointer analysis with directional assignments. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Vancouver, British Columbia, Canada, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Dean, D. Grove, and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In European Conference on Object-Oriented Programming (ECOOP), August 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Fändrich, J. S. Foster, Z. Su, and A. Aiken. Partial online cycle elimination in inclusion constraint graphs. In Conference on Programming Language Design and Implementation (PLDI), June 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Fink, K. Knobe, and V. Sarkar. Unified analysis of array and object reference in strongly typed languages. In Proceedings of the 2000 Static Analysis Symposium, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Fink and F. Qian. Design, implementation and evaluation of adaptive recompilation with on-stack replacement, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Fowler. Refactoring: improving the design of existing code. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Z. Guyer and C. Lin. Client-driven pointer analysis. In International Static Analysis Symposium (SAS), San Diego, CA, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. N. Heintze and O. Tardieu. Demand-driven pointer analysis. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. N. Heintze and O. Tardieu. Ultra-fast aliasing analysis using CLA: A million lines of C code in a second. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Hind. Pointer analysis: Haven't we solved this problem yet? In ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE), Snowbird, Utah, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Hirzel, A. Diwan, and M. Hind. Pointer analysis in the presence of dynamic class loading. In European Conference on Object-Oriented Programming (ECOOP), June 2004.Google ScholarGoogle ScholarCross RefCross Ref
  21. M. Hirzel, D. von Dincklage, A. Diwan, and M. Hind. Fast online pointer analysis. Technical report, IBM Research RC23638, June 2005.Google ScholarGoogle Scholar
  22. S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. In SIGSOFT'95: Proceedings of the Third ACM SIGSOFT Symposium on the Foundations of Software Engineering, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. Kodumal and A. Aiken. The set constraint/CFL reachability connection in practice. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Kodumal and A. Aiken. Banshee: A scalable constraint-based analysis toolkit. In SAS '05: Proceedings of the 12th International Static Analysis Symposium. London, United Kingdom, September 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. O. Lhoták. Spark: A flexible points-to analysis framework for Java. Master's thesis, McGill University, December 2002.Google ScholarGoogle Scholar
  26. O. Lhoták and L. Hendren. Scaling Java points-to analysis using Spark. In International Conference on Compiler Construction (CC), Warsaw, Poland, April 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. O. Lhoták and L. Hendren. Jedd: a BDD-based relational extension of Java. In Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. Liang, M. Pennings, and M. J. Harrold. Extending and evaluating flow-insensitive and context-insensitive points-to analyses for Java. In Workshop on Program Analysis for Software Tools and Engineering (PASTE), Snowbird, Utah, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Liang, M. Pennings, and M. J. Harrold. Evaluating the precision of static reference analysis using profiling. In Internal Symposium of Software Testing and Analysis (ISSTA), Rome, Italy, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Milanova, A. Rountev, and B. G. Ryder. Parameterized object sensitivity for points-to and side-effect analyses for Java. In International Symposium on Software Testing and Analysis (ISSTA), Rome, Italy, July 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. R. O'Callahan. Generalized Aliasing as a Basis for Program Analysis Tools. PhD thesis, Carnegie Mellon University, November 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. T. Reps. Solving demand versions of interprocedural analysis problems. In International Conference on Compiler Construction (CC), Edinburgh, Scotland, April 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. T. Reps. Program analysis via graph reachability. Information and Software Technology, 40(11-12):701--726, November/December 1998.Google ScholarGoogle ScholarCross RefCross Ref
  34. T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural dataflow analysis via graph reachability. In ACM Symposium on Principles of Programming Languages (POPL), San Francisco, CA, pages 49--61, January 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. T. Reps, S. Horwitz, M. Sagiv, and G. Rosay. Speeding up slicing. In ACM SIGSOFT Symposium on the Foundations of Software Engineering (FSE), New Orleans, LA, December 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Rountev and S. Chandra. Off-line variable substitution for scaling points-to analysis. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Vancouver, British Columbia, Canada, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. A. Rountev, A. Milanova, and B. G. Ryder. Points-to analysis for Java using annotated constraints. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Tampa Bay, Florida, October 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. B. G. Ryder. Dimensions of precision in reference analysis of object-oriented programming languages. In International Conference on Compiler Construction (CC), Warsaw, Poland, April 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Z. Su, M. Fähndrich, and A. Aiken. Projection merging: Reducing redundancies in inclusion constraint graphs. In ACM Symposium on Principles of Programming Languages (POPL), Boston, Massachusetts, pages 81--95, January 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. V. Sundaresan, L. J. Hendren, C. Razafimahefa, R. Vallée-Rai, P. Lam, E. Gagnon, and C. Godin. Practical virtual method call resolution for Java. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Minneapolis, MN, October 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. F. Tip and J. Palsberg. Scalable propagation-based call graph construction algorithms. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Minneapolis, MN, October 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. R. Vallée-Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot - a Java optimization framework. In Proceedings of CASCON 1999, pages 125--135, 1999.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. F. Vivien and M. C. Rinard. Incrementalized pointer and escape analysis. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Snowbird, Utah, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. J. Whaley and M. Lam. An efficient inclusion-based points-to analysis for strictly-typed languages. In International Static Analysis Symposium (SAS), Madrid, Spain, September 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Proceedings of the Conference on Programming Language Design and Implementation. ACM Press, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. J. Whaley and M. Rinard. Compositional pointer and escape analysis for Java programs. In Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), Denver, Colorado, November 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. M. Yannakakis. Graph-theoretic methods in database theory. In ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS), April 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. S. H. Yong, S. Horwitz, and T. W. Reps. Pointer analysis for programs with structures and casting. In SIGPLAN Conference on Programming Language Design and Implementation, pages 91--103, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. J. Zhu and S. Calman. Symbolic pointer analysis revisited. In Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Demand-driven points-to analysis 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
      • Published in

        cover image ACM Conferences
        OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
        October 2005
        562 pages
        ISBN:1595930310
        DOI:10.1145/1094811
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 40, Issue 10
          Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications
          October 2005
          531 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1103845
          Issue’s Table of Contents

        Copyright © 2005 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 12 October 2005

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate268of1,244submissions,22%

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader