skip to main content
research-article

Strictly declarative specification of sophisticated points-to analyses

Published:25 October 2009Publication History
Skip Abstract Section

Abstract

We present the DOOP framework for points-to analysis of Java programs. DOOP builds on the idea of specifying pointer analysis algorithms declaratively, using Datalog: a logic-based language for defining (recursive) relations. We carry the declarative approach further than past work by describing the full end-to-end analysis in Datalog and optimizing aggressively using a novel technique specifically targeting highly recursive Datalog programs.

As a result, DOOP achieves several benefits, including full order-of-magnitude improvements in runtime. We compare DOOP with Lhotak and Hendren's PADDLE, which defines the state of the art for context-sensitive analyses. For the exact same logical points-to definitions (and, consequently, identical precision) DOOP is more than 15x faster than PADDLE for a 1-call-site sensitive analysis of the DaCapo benchmarks, with lower but still substantial speedups for other important analyses. Additionally, DOOP scales to very precise analyses that are impossible with PADDLE and Whaley et al.'s bddbddb, directly addressing open problems in past literature. Finally, our implementation is modular and can be easily configured to analyses with a wide range of characteristics, largely due to its declarativeness.

References

  1. W. C. Benton and C. N. Fischer. Interactive, scalable, declarative program analysis: from prototype to implementation. In PPDP '07: Proc. of the 9th ACM SIGPLAN int. conf. on Principles and practice of declarative programming, pages 13--24, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Berndl, O. Lhotak, F. Qian, L. J. Hendren, and N. Umanee. Points-to analysis using bdds. In PLDI, pages 103--114. ACM, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Bravenboer and Y. Smaragdakis. Exception analysis and points-to analysis: Better together. In L. Dillon, editor, ISSTA '09: Proceedings of the 2009 International Symposium on Software Testing and Analysis, New York, NY, USA, July 2009. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. Dawson, C. R. Ramakrishnan, and D. S. Warren. Practical program analysis using general purpose logic programming systems--a case study. In PLDI '96: Proc. of the ACM SIGPLAN 1996 conf. on Programming language design and implementation, pages 117--126, New York, NY, USA, 1996. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. K. Debray. Unfold/fold transformations and loop optimization of logic programs. In PLDI '88: Proc. of the ACM SIGPLAN 1988 conf. on Programming Language design and Implementation, pages 297--307, New York, NY, USA, 1988. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Eichberg, S. Kloppenburg, K. Klose, and M. Mezini. Defining and continuous checking of structural program dependencies. In ICSE '08: Proc. of the 30th int. conf. on Software engineering, pages 391--400, New York, NY, USA, 2008. ACM Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. J. Fink. T.J. Watson libraries for analysis (WALA). http://wala.sourceforge.net.Google ScholarGoogle Scholar
  8. A. Gupta, I. S. Mumick, and V. S. Subrahmanian. Maintaining views incrementally. In SIGMOD '93: Proc. of the 1993 ACM SIGMOD int. conf. on Management of data, pages 157--166, New York, NY, USA, 1993. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E. Hajiyev, M. Verbaere, and O. de Moor. Codequest: Scalable source code queries with datalog. In Proc. European Conf. on Object-Oriented Programming (ECOOP), pages 2--27. Spinger, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. B. Hardekopf and C. Lin. The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code. In PLDI'07: Proc. ACM SIGPLAN conf. on Programming Language Design and Implementation, pages 290--299, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. B. Hardekopf and C. Lin. Semi-sparse flow-sensitive pointer analysis. In POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 226--238, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Heintze and O. Tardieu. Demand-driven pointer analysis. In PLDI '01: Proc. of the ACM SIGPLAN 2001 conf. on Programming language design and implementation, pages 24--34, New York, NY, USA, 2001. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. S. Lam, J. Whaley, V. B. Livshits, M. C. Martin, D. Avots, M. Carbin, and C. Unkel. Context-sensitive program analysis as database queries. In PODS '05: Proc. of the twenty-fourth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pages 1--12, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Lattner, A. Lenharth, and V. Adve. Making context-sensitive points-to analysis with heap cloning practical for the real world. SIGPLAN Not., 42(6):278--289, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. O. Lhotak. Program Analysis using Binary Decision Diagrams. PhD thesis, McGill University, Jan. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. O. Lhotak and L. Hendren. Scaling Java points-to analysis using Spark. In G. Hedin, editor, Compiler Construction, 12th Int. Conf., volume 2622 of LNCS, pages 153--169, Warsaw, Poland, April 2003. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. O. Lhotak and L. Hendren. Jedd: a bdd-based relational extension of java. In PLDI '04: Proc. of the ACM SIGPLAN 2004 conf. on Programming language design and implementation, pages 158--169, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. O. Lhotak and L. Hendren. Evaluating the benefits of context-sensitive points-to analysis using a BDD-based implementation. ACM Trans. Softw. Eng. Methodol., 18(1):1--53, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. B. Livshits, J. Whaley, and M. S. Lam. Reflection analysis for Java. In K. Yi, editor, Proceedings of the 3rd Asian Symposium on Programming Languages and Systems, volume 3780. Springer-Verlag, Nov. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Milanova, A. Rountev, and B. G. Ryder. Parameterized object sensitivity for points-to analysis for java. ACM Trans. Softw. Eng. Methodol., 14(1):1--41, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for java. In Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06), pages 308--319, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. M. Nystrom, H.-S. Kim, and W. mei W. Hwu. Importance of heap specialization in pointer analysis. In PASTE '04: Proc. of the 5th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, pages 43--48, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. T. Reps. Demand interprocedural program analysis using logic databases. In R. Ramakrishnan, editor, Applications of Logic Databases, pages 163--196. Kluwer Academic Publishers, 1994.Google ScholarGoogle Scholar
  24. T. W. Reps. Solving demand versions of interprocedural analysis problems. In CC '94: Proc. of the 5th Int. Conf. on Compiler Construction, pages 389--403, London, UK, 1994. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. Saha and C. R. Ramakrishnan. Incremental and demand-driven points-to analysis using logic programming. In PPDP '05: Proc. of the 7th ACM SIGPLAN int. conf. on Principles and practice of declarative programming, pages 117--128, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Sridharan and R. Bodik. Refinement-based context-sensitive points-to analysis for java. In PLDI '06: Proc. of the 2006 ACM SIGPLAN conf. on Programming language design and implementation, pages 387--400, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Sridharan, D. Gopan, L. Shan, and R. Bodć1k. Demand-driven points-to analysis for java. In OOPSLA '05: Proc. of the 20th annual ACM SIGPLAN conf. on Object oriented programming, systems, languages, and applications, pages 59--76, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Whaley, D. Avots, M. Carbin, and M. S. Lam. Using datalog with binary decision diagrams for program analysis. In K. Yi, editor, APLAS, volume 3780 of Lecture Notes in Computer Science, pages 97--118. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In PLDI '04: Proc. of the ACM SIGPLAN 2004 conf. on Programming language design and implementation, pages 131--144, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. G. Xu and A. Rountev. Merging equivalent contexts for scalable heap-cloning-based context-sensitive points-to analysis. In ISSTA '08: Proc. of the 2008 int. symposium on Software testing and analysis, pages 225--236, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. X. Zheng and R. Rugina. Demand-driven alias analysis for c. In POPL '08: Proc. of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 197--208, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Strictly declarative specification of sophisticated points-to analyses

          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

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 44, Issue 10
            OOPSLA '09
            October 2009
            554 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1639949
            Issue’s Table of Contents
            • cover image ACM Conferences
              OOPSLA '09: Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications
              October 2009
              590 pages
              ISBN:9781605587660
              DOI:10.1145/1640089

            Copyright © 2009 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: 25 October 2009

            Check for updates

            Qualifiers

            • research-article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader