A framework for call graph construction algorithms

A large number of call graph construction algorithms for object-oriented and functional languages have been proposed, each embodying different tradeoffs between analysis cost and call graph precision. In this article we present a unifying framework for understanding call graph construction algorithms and an empirical comparison of a representative set of algorithms. We first present a general parameterized algorithm that encompasses many well-known and novel call graph construction algorithms. We have implemented this general algorithm in the Vortex compiler infrastructure, a mature, multilanguage, optimizing compiler. The Vortex implementation provides a "level playing field" for meaningful cross-algorithm performance comparisons. The costs and benefits of a number of call graph construction algorithms are empirically assessed by applying their Vortex implementation to a suite of sizeable (5,000 to 50,000 lines of code) Cecil and Java programs. For many of these applications, interprocedural analysis enabled substantial speed-ups over an already highly optimized baseline. Furthermore, a significant fraction of these speed-ups can be obtained through the use of a scalable, near-linear time call graph construction algorithm.

[1]  Laurie J. Hendren,et al.  Practical virtual method call resolution for Java , 2000, OOPSLA '00.

[2]  Urs Hölzle,et al.  Dynamic vs . Static Optimization Techniques for Object-Oriented Languages , 1996 .

[3]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[4]  Dan C. Stefanescu,et al.  An equational framework for the flow analysis of higher order functional programs , 1994, LFP '94.

[5]  Mary F. Fernández,et al.  Simple and effective link-time optimization of Modula-3 programs , 1995, PLDI '95.

[6]  Suresh Jagannathan,et al.  A unified treatment of flow analysis in higher-order languages , 1995, POPL '95.

[7]  Craig Chambers,et al.  Whole-program optimization of object-oriented languages , 1996 .

[8]  David F. Bacon,et al.  Fast static analysis of C++ virtual function calls , 1996, OOPSLA '96.

[9]  Paul Hudak,et al.  ORBIT: an optimizing compiler for scheme , 1986, SIGPLAN '86.

[10]  Craig Chambers,et al.  Iterative type analysis and extended message splitting; optimizing dynamically-typed object-oriented programs , 1990, PLDI '90.

[11]  Urs Hölzle,et al.  Dynamic versus Static Optimization Techniques for Object-Oriented Languages , 1995, Theory Pract. Object Syst..

[12]  Jens Palsberg,et al.  Type inference of SELF: Analysis of objects with dynamic and multiple inheritance , 1995, Softw. Pract. Exp..

[13]  Susan Horwitz,et al.  Fast and accurate flow-insensitive points-to analysis , 1997, POPL '97.

[14]  R. Nigel Horspool,et al.  Compile-Time Analysis of Object-Oriented Programs , 1992, CC.

[15]  Ken Kennedy,et al.  Constructing the Procedure Call Multigraph , 1990, IEEE Trans. Software Eng..

[16]  David A. McAllester,et al.  Linear-time subtransitive control flow analysis , 1997, PLDI '97.

[17]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA 1991.

[18]  Barbara G. Ryder,et al.  Static Type Determination for C++ , 1994, C++ Conference.

[19]  Laurie J. Hendren,et al.  Context-sensitive interprocedural points-to analysis in the presence of function pointers , 1994, PLDI '94.

[20]  David Grove,et al.  Fast interprocedural class analysis , 1998, POPL '98.

[21]  Alexander Aiken,et al.  Set Constraints: Results, Applications, and Future Directions , 1994, PPCP.

[22]  Jens Palsberg,et al.  Type Inference of SELF , 1993, ECOOP.

[23]  J. Michael Ashley,et al.  A practical and flexible flow analysis for higher-order languages , 1998, TOPL.

[24]  Flemming Nielson,et al.  Infinitary control flow analysis: a collecting semantics for closure analysis , 1997, POPL '97.

[25]  Monica S. Lam,et al.  Efficient context-sensitive pointer analysis for C programs , 1995, PLDI '95.

[26]  Ken Kennedy,et al.  Efficient call graph analysis , 1992, LOPL.

[27]  David Grove,et al.  Profile-guided receiver class prediction , 1995, OOPSLA.

[28]  Arun Lakhotia Constructing call multigraphs using dependence graphs , 1993, POPL '93.

[29]  J. Michael Ashley The effectiveness of flow analysis for inlining , 1997, ICFP '97.

[30]  Ole Agesen Constraint-Based Type Inference and Parametric Polymorphism , 1994, SAS.

[31]  Justin O. Graver,et al.  TS: an optimizing compiler for smalltalk , 1988, OOPSLA 1988.

[32]  David Grove,et al.  Call graph construction in object-oriented languages , 1997, OOPSLA '97.

[33]  L. Peter Deutsch,et al.  Efficient implementation of the smalltalk-80 system , 1984, POPL.

[34]  Jens Palsberg,et al.  Making Type Inference Practical , 1992, ECOOP.

[35]  Jens Palsberg,et al.  Scalable propagation-based call graph construction algorithms , 2000, OOPSLA '00.

[36]  Dharma P. Agrawal,et al.  Precise call graph construction for OO programs in the presence of virtual functions , 1997, Proceedings of the 1997 International Conference on Parallel Processing (Cat. No.97TB100162).

[37]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[38]  David Grove The impact of interprocedural class analysis on optimization , 1995, CASCON.

[39]  Andrew A. Chien,et al.  Precise Concrete Type Inference for Object-Oriented Languages , 1994, OOPSLA.

[40]  Andrew A. Chien,et al.  Precise concrete type inference for object-oriented languages , 1994, OOPSLA 1994.

[41]  Suresh Jagannathan,et al.  Polymorphic splitting: an effective polyvariant flow analysis , 1998, TOPL.

[42]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[43]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[44]  Andrew A. Chien,et al.  Optimization of object-oriented and concurrent programs , 1996 .

[45]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

[46]  David Grove,et al.  Effective interprocedural optimization of object-oriented languages , 1998 .

[47]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[48]  Barbara G. Ryder,et al.  Constructing the Call Graph of a Program , 1979, IEEE Transactions on Software Engineering.

[49]  Martin Alt,et al.  Generation of Efficient Interprocedural Analyzers with PAG , 1995, SAS.

[50]  Urs Hölzle,et al.  Optimizing dynamically-dispatched calls with run-time type feedback , 1994, PLDI '94.

[51]  Fritz Henglein,et al.  Efficient Type Inference for Higher-Order Binding-Time Analysis , 1991, FPCA.

[52]  Jens Palsberg,et al.  Analysis of Objects with Dynamic and Multiple Inheritance , 1993 .

[53]  Ole Agesen,et al.  Concrete type inference: delivering object-oriented applications , 1995 .

[54]  David Grove,et al.  Vortex: an optimizing compiler for object-oriented languages , 1996, OOPSLA '96.

[55]  David Grove,et al.  Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis , 1995, ECOOP.

[56]  Ralph E. Johnson,et al.  TS: an optimizing compiler for smalltalk , 1988, OOPSLA '88.

[57]  Barbara G. Ryder,et al.  Pointer-induced aliasing: a problem classification , 1991, POPL '91.

[58]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[59]  Ole Agesen The Cartesian Product Algorithm: Simple and Precise Type Inference Of Parametric Polymorphism , 1995, ECOOP.

[60]  Jens Palsberg,et al.  Object-oriented type inference , 1991, OOPSLA '91.

[61]  Robert E. Tarjan,et al.  Efficiency of a Good But Not Linear Set Union Algorithm , 1972, JACM.

[62]  Jeffrey D. Ullman,et al.  Global Data Flow Analysis and Iterative Algorithms , 1976, J. ACM.

[63]  Amer Diwan,et al.  Simple and effective analysis of statically-typed object-oriented programs , 1996, OOPSLA '96.

[64]  Jens Palsberg,et al.  From polyvariant flow information to intersection and union types , 1998, POPL '98.