skip to main content
research-article
Open Access

SHARP: fast incremental context-sensitive pointer analysis for Java

Published:29 April 2022Publication History
Skip Abstract Section

Abstract

We present SHARP, an incremental context-sensitive pointer analysis algorithm that scales to real-world large complex Java programs and can also be efficiently parallelized. To our knowledge, SHARP is the first algorithm to tackle context-sensitivity in the state-of-the-art incremental pointer analysis (with regards to code modifications including both statement additions and deletions), which applies to both k-CFA and k-obj. To achieve it, SHARP tackles several technical challenges: soundness, redundant computations, and parallelism to improve scalability without losing precision. We conduct an extensive empirical evaluation of SHARP on large and popular Java projects and their code commits, showing impressive performance improvement: our incremental algorithm only requires on average 31 seconds to handle a real-world code commit for k-CFA and k-obj, which has comparable performance to the state-of-the-art incremental context-insensitive pointer analysis. Our parallelization further improves the performance and enables SHARP to finish within 18 seconds per code commit on average on an eight-core machine.

References

  1. L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, 1994.Google ScholarGoogle Scholar
  2. M. A. Bender, J. T. Fineman, S. Gilbert, and R. E. Tarjan. A new approach to incremental cycle detection and related problems. ACM Trans. Algorithms, 12 (2): 14:1–14:22, Dec. 2015. ISSN 1549-6325. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Edvinsson, J. Lundberg, and W. Löwe. Parallel points-to analysis for multi-core machines. In Proceedings of the 6th International Conference on High Performance and Embedded Architectures and Compilers, HiPEAC ’11, pages 45–54, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0241-8. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Gupta, I. S. Mumick, and V. S. Subrahmanian. Maintaining views incrementally. In Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data, SIGMOD ’93, pages 157–166, New York, NY, USA, 1993. ACM. ISBN 0-89791-592-5. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Z. Guyer and C. Lin. Client-driven pointer analysis. In Proceedings of the 10th International Conference on Static Analysis, SAS’03, pages 214–236, Berlin, Heidelberg, 2003. Springer-Verlag. ISBN 3-540-40325-6. URL http://dl.acm.org/citation.cfm?id=1760267.1760284.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. B. Hardekopf and C. Lin. The ant and the grasshopper: Fast and accurate pointer analysis for millions of lines of code. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’07, page 290–299, New York, NY, USA, 2007. Association for Computing Machinery. ISBN 9781595936332. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. Hardekopf and C. Lin. Flow-sensitive pointer analysis for millions of lines of code. In Proceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization, CGO ’11, pages 289–298, Washington, DC, USA, 2011. IEEE Computer Society. ISBN 978-1-61284-356-8. URL http://dl.acm.org/citation.cfm?id=2190025.2190075.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Hassanshahi, R. K. Ramesh, P. Krishnan, B. Scholz, and Y. Lu. An efficient tunable selective points-to analysis for large codebases. In Proceedings of the 6th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis, SOAP 2017, pages 13–18, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-5072-3. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Jeon, S. Jeong, and H. Oh. Precise and scalable points-to analysis via data-driven context tunneling. Proc. ACM Program. Lang., 2 (OOPSLA): 140:1–140:29, Oct. 2018. ISSN 2475-1421. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Jeong, M. Jeon, S. Cha, and H. Oh. Data-driven context-sensitivity for points-to analysis. Proc. ACM Program. Lang., 1 (OOPSLA): 100:1–100:28, Oct. 2017. ISSN 2475-1421. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. G. Kastrinis and Y. Smaragdakis. Hybrid context-sensitivity for points-to analysis. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, pages 423–434, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-2014-6. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Krainz and M. Philippsen. Diff graphs for a fast incremental pointer analysis. In Proceedings of the 12th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, ICOOOLPS’17, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450350884. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. Lhoták. Spark: A flexible points-to analysis framework for Java. Master’s thesis, McGill University, December 2002.Google ScholarGoogle Scholar
  14. O. Lhoták and L. Hendren. Evaluating the benefits of context-sensitive points-to analysis using a bdd-based implementation. ACM Trans. Softw. Eng. Methodol., 18 (1): 3:1–3:53, Oct. 2008. ISSN 1049-331X. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Y. Li, T. Tan, A. Møller, and Y. Smaragdakis. Scalability-first pointer analysis with self-tuning context-sensitivity. ESEC/FSE 2018, page 129–140, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450355735. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Y. Li, T. Tan, A. Møller, and Y. Smaragdakis. Precision-guided context sensitivity for pointer analysis. 2 (OOPSLA), oct 2018. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. B. Liu and J. Huang. D4: Fast concurrency debugging with parallel differential analysis. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2018, pages 359–373, New York, NY, USA, 2018. ACM. ISBN 978-1-4503-5698-5. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Liu, J. Huang, and L. Rauchwerger. Rethinking incremental and parallel pointer analysis. ACM Trans. Program. Lang. Syst., 41 (1): 6:1–6:31, Mar. 2019. ISSN 0164-0925. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Lu, L. Shang, X. Xie, and J. Xue. An incremental points-to analysis with cfl-reachability. In Proceedings of the 22Nd International Conference on Compiler Construction, CC’13, pages 61–81, Berlin, Heidelberg, 2013. Springer-Verlag. ISBN 978-3-642-37050-2. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Marron. Modeling the Heap: A Practical Approach. PhD thesis, USA, 2008. AAI3346744.Google ScholarGoogle Scholar
  21. M. Méndez-Lojo, A. Mathew, and K. Pingali. Parallel inclusion-based points-to analysis. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA ’10, pages 428–443, New York, NY, USA, 2010. ACM. ISBN 978-1-4503-0203-6. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. Méndez-Lojo, M. Burtscher, and K. Pingali. A gpu implementation of inclusion-based points-to analysis. In Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’12, pages 107–116, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1160-1. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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, Jan. 2005. ISSN 1049-331X. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. V. Nagaraj and R. Govindarajan. Parallel flow-sensitive pointer analysis by graph-rewriting. In Proceedings of the 22Nd International Conference on Parallel Architectures and Compilation Techniques, PACT ’13, pages 19–28, Piscataway, NJ, USA, 2013. IEEE Press. ISBN 978-1-4799-1021-2. URL http://dl.acm.org/citation.cfm?id=2523721.2523728.Google ScholarGoogle ScholarCross RefCross Ref
  25. S. Putta and R. Nasre. Parallel replication-based points-to analysis. In Proceedings of the 21st International Conference on Compiler Construction, CC’12, pages 61–80, Berlin, Heidelberg, 2012. Springer-Verlag. ISBN 978-3-642-28651-3. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Sagiv, T. Reps, and R. Wilhelm. Solving shape-analysis problems in languages with destructive updating. ACM Trans. Program. Lang. Syst., 20 (1): 1–50, jan 1998. ISSN 0164-0925. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. Saha and C. R. Ramakrishnan. Incremental and demand-driven points-to analysis using logic programming. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP ’05, pages 117–128, New York, NY, USA, 2005. ACM. ISBN 1-59593-090-6. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. Saha and C. R. Ramakrishnan. Symbolic support graph: A space efficient data structure for incremental tabled evaluation. In M. Gabbrielli and G. Gupta, editors, Logic Programming, 21st International Conference, ICLP 2005, Sitges, Spain, October 2-5, 2005, Proceedings, volume 3668 of Lecture Notes in Computer Science, pages 235–249. Springer, 2005. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Saha and C. R. Ramakrishnan. A local algorithm for incremental evaluation of tabled logic programs. In Proceedings of the 22nd International Conference on Logic Programming, ICLP’06, page 56–71, Berlin, Heidelberg, 2006. Springer-Verlag. ISBN 3540366350. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. L. Shang, Y. Lu, and J. Xue. Fast and precise points-to analysis with incremental cfl-reachability summarisation: Preliminary experience. In Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, ASE 2012, pages 270–273, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1204-2. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. O. Shivers. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie Mellon University, May 1991.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Y. Smaragdakis, M. Bravenboer, and O. Lhoták. Pick your contexts well: Understanding object-sensitivity. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’11, pages 17–30, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0490-0. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Y. Smaragdakis, G. Kastrinis, and G. Balatsouras. Introspective analysis: Context-sensitivity, across the board. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 485–495, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Y. Smaragdakis, G. Kastrinis, and G. Balatsouras. Introspective analysis: Context-sensitivity, across the board. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 485–495, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. M. Sridharan and R. Bodík. Refinement-based context-sensitive points-to analysis for java. In Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’06, pages 387–400, New York, NY, USA, 2006. ACM. ISBN 1-59593-320-4. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. M. Sridharan, D. Gopan, L. Shan, and R. Bodík. Demand-driven points-to analysis for java. In Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’05, pages 59–76, New York, NY, USA, 2005. ACM. ISBN 1-59593-031-0. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Sridharan, S. Chandra, J. Dolby, S. J. Fink, and E. Yahav. Aliasing in object-oriented programming. chapter Alias Analysis for Object-oriented Programs, pages 196–232. Springer-Verlag, Berlin, Heidelberg, 2013. ISBN 978-3-642-36945-2. URL http://dl.acm.org/citation.cfm?id=2554511.2554523.Google ScholarGoogle Scholar
  38. Y. Su, D. Ye, and J. Xue. Parallel pointer analysis with cfl-reachability. In Proceedings of the 2014 Brazilian Conference on Intelligent Systems, BRACIS ’14, pages 451–460, Washington, DC, USA, 2014. IEEE Computer Society. ISBN 978-1-4799-5618-0. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. T. Tan, Y. Li, and J. Xue. Efficient and precise points-to analysis: Modeling the heap by merging equivalent automata. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, pages 278–291, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-4988-8. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. WALA. T. j. watson libraries for analysis (wala). http://wala.sourceforge.net/, 2017.Google ScholarGoogle Scholar
  41. S. Wei and B. G. Ryder. Adaptive context-sensitive analysis for javascript. In J. T. Boyland, editor, 29th European Conference on Object-Oriented Programming (ECOOP 2015), volume 37 of Leibniz International Proceedings in Informatics (LIPIcs), pages 712–734, Dagstuhl, Germany, 2015. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik. ISBN 978-3-939897-86-6. URL http://drops.dagstuhl.de/opus/volltexte/2015/5244. Google ScholarGoogle ScholarCross RefCross Ref
  42. J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation, PLDI ’04, pages 131–144, New York, NY, USA, 2004. ACM. ISBN 1-58113-807-5. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J.-s. Yur, B. G. Ryder, and W. A. Landi. An incremental flow- and context-sensitive pointer aliasing analysis. In Proceedings of the 21st International Conference on Software Engineering, ICSE ’99, pages 442–451, New York, NY, USA, 1999. ACM. ISBN 1-58113-074-0. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. S. Zhan and J. Huang. Echo: Instantaneous in situ race detection in the ide. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, pages 775–786, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4218-6. URL Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. Zhao, M. G. Burke, and V. Sarkar. Parallel sparse flow-sensitive points-to analysis. In Proceedings of the 27th International Conference on Compiler Construction, CC 2018, pages 59–70, New York, NY, USA, 2018. ACM. ISBN 978-1-4503-5644-2. URL Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. SHARP: fast incremental context-sensitive pointer 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

      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!