Advertisement

Evaluating a Demand Driven Technique for Call Graph Construction

  • Gagan Agrawal
  • Jinqian Li
  • Qi Su
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2304)

Abstract

With the increasing importance of just-in-time or dynamic compilation and the use of program analysis as part of software development environments, there is a need for techniques for demand driven construction of a call graph. We have developed a technique for demand driven call graph construction which handles dynamic calls due to polymorphism in object-oriented languages. Our demand driven technique has the same accuracy as the corresponding exhaustive technique. The reduction in the graph construction time depends upon the ratio of the cardinality of the set of influencing nodes and the total number of nodes in the entire program.

This paper presents a detailed experimental evaluation of the benefits of the demand driven technique over the exhaustive one. We consider a number of scenarios, including resolving a single call site, resolving all call sites in a method, resolving all call sites within all methods in a class, and computing reaching definitions of all actual parameters inside a method. We compare the analysis time, the number of methods analyzed, and the number of nodes in the working set for the demand driven and exhaustive analyses.

We use SPECJVM programs as benchmarks for our experiments. Our experiments show for the larger SPECJVM programs, javac, mpegaudio, and jack, demand driven analysis on the average takes nearly an order of magnitude less time than exhaustive analysis.

References

  1. 1.
    Gagan Agrawal. Simultaneous demand-driven data-flow and call graph analysis. In Proceedings of International Conference on Software Maintainance (ICSM), September 1999.Google Scholar
  2. 2.
    Gagan Agrawal. Demand-drive call graph construction. In Proceedings of the Compiler Construction (CC) Conference, March 2000.Google Scholar
  3. 3.
    David Bacon and Peter F. Sweeney. Fast static analysis of c++ virtual function calls. In Eleventh Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’ 96), pages 324–341, October 1996.Google Scholar
  4. 4.
    Brad Calder and Dirk Grunwald. Reducing indirect function call overhead in C++ programs. In Conference Record of POPL’ 94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 397–408, Portland, Oregon, January 1994.Google Scholar
  5. 5.
    D. Callahan. The program summary graph and flow-sensitive interprocedural data flow analysis. In Proceedings of the SIGPLAN’ 88 Conference on Programming Language Design and Implementation, Atlanta, GA, June 1988.Google Scholar
  6. 6.
    R. Chatterjee, B. G. Ryder, and W. A. Landi. Relevant Context Inference. In Proceedings of the Conference on Principles of Programming Languages (POPL), pages 133–146, January 1999.Google Scholar
  7. 7.
    Jeffrey Dean, Craig Chambers, and David Grove. Selective specialization for object-oriented languages. In Proceedings of the ACM SIGPLAN’95 Conference on Programming Language Design and Implementation (PLDI), pages 93–102, La Jolla, California, 18-21 June 1995. SIGPLAN Notices 30(6), cdJune 1995.CrossRefGoogle Scholar
  8. 8.
    Greg DeFouw, David Grove, and Craig Chambers. Fast interprocedural class analysis. In Proceedings of the POPL’98 Conference, 1998.Google Scholar
  9. 9.
    A. Diwan, K. S. McKinley, and J. E. B. Moss. Using Types to Analyze and Optimize Object-Oriented Programs. ACM Transactions on Programming Languages and Systems, 23(1):30–72, January 2001.CrossRefGoogle Scholar
  10. 10.
    E. Duesterwald, R. Gupta, and M. L. Soffia. A Practical Framework for Demand-Driven Interprocedural Data Flow Analysis. ACM Transactions on Programming Languages and Systems, 19(6):992–1030, November 1997.CrossRefGoogle Scholar
  11. 11.
    David Grove, Greg DeFouw, Jeffrey Dean, and Craig Chambers. Call graph construction in object-oriented languages. In Proceedings of the Conference on Object Oriented Programming Systems, Languages and Applications, 1997.Google Scholar
  12. 12.
    S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural data flow analysis. In In SIGSOFT’ 95: Proceedings of the Third ACM SIGSOFT Symposium on the Foundations of Software Engineering, pages 104–115, 1995.Google Scholar
  13. 13.
    Jens Palsberg and Patrick O'Keefe. A type system equivalent to flow analysis. In Conference Record of POPL’ 95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 367–378, San Francisco, California, January 1995.Google Scholar
  14. 14.
    Hemant Pande and Barbara Ryder. Data-flow-based virtual function resolution. In Proceedings of the Third International Static Analysis Symposium, 1996.Google Scholar
  15. 15.
    M. Porat, M. Biberstein, L. Koved, and M. Mendelson. Automatic detection of immutable fields in Java. In Proceedings of CASCON, 2000.Google Scholar
  16. 16.
    Gregg Rothermel and M. J. Harrold. Analyzing regression test selection. IEEE Transactions on Software Engineering, 1996.Google Scholar
  17. 17.
    Atanas Routnev, Barbara G. Ryder, and William Landi. Data-Flow Analysis of Program Fragments. In Proceedings of the Conference on Foundations of Software Engineering (FSE), pages 235–253, September 1999.Google Scholar
  18. 18.
    O. Shivers. The semantics of Scheme control-flow analysis. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation, volume 26, pages 190–198, New Haven, CN, June 1991.Google Scholar
  19. 19.
    V. C. Sreedhar, M. Burke, and J. D. Choi. A Framework for Interprocedural Optimization in the Presence of Dynamic Class Loading. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2000.Google Scholar
  20. 20.
    Vijay Sundaresan, Laurie Hendren, Chrislain Razafimahefa, Raja Vallee-Rai, Patrick Lam, Etienne Gagnon, and Charles Godin. Practical virtual method call resolution for Java. In Fifteenth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’ 2000), pages 264–280. ACM Press, October 2000.Google Scholar
  21. 21.
    Frank Tip and Jens Palsberg. Scalable propagation-based call graph construction algorithms. In Fifteenth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’ 2000), pages 281–293. ACM Press, October 2000.Google Scholar
  22. 22.
    Raja Vallee-Rai. Soot: A Java ByteCode Optimization Framework. Master’s thesis, McGill University, 1999.Google Scholar
  23. 23.
    Mark Weiser. Program slicing. IEEE Transactions on Software Engineering, 10:352–357, 1984.CrossRefGoogle Scholar
  24. 24.
    A. Zaks, V. Feldman, and N. Aizikowitz. Sealed calls in java packages. In Proceedings of Conference on Object Oriented Programming Systems and Languages (OOPSLA), pages 83–92. ACM Press, October 2000.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Gagan Agrawal
    • 1
  • Jinqian Li
    • 2
  • Qi Su
    • 2
  1. 1.Department of Computer and Information SciencesOhio State University Columbus
  2. 2.Department of Computer and Information SciencesUniversity of DelawareNewark

Personalised recommendations