A call graph is defined as a set of directed edges connecting call sites (statements invoking method calls) to corresponding target methods [6]. It is a very powerful tool for program analysis and can be used to: help plan testing strategies, reduce program size (by eliminating sub-routines that are not invoked) and help programmers understand and debug large programs. Often the method invoked due to a specific call is determined at runtime based on the context in which the call is made, hence in a call graph a single call site could have multiple target methods. This is especially evident in object oriented languages where inheritance and polymorphism make method calls highly dependent on the execution context. To get the set of target methods associated with a call site we can either observe one or more executions of the program and note all methods invoked from a call site (dynamic call graph generation) or statically determine the possible methods (static call graph construction). Dynamic call graphs tend to under-estimate the number of target methods for a call site where as static call graphs tend to over-estimate this this number. A theoretically ideal call graph is the union of the dynamic call graphs over all possible executions of the program. Dynamic call graphs are not safe and generating static call graphs is computationally expensive. To ameliorate the overhead we propose an incremental call graph generation approach which will compute graphs for fragments of the program as they are being developed. It will then recursively combine fragments until a graph for the whole program is generated. The graph will be as precise as corresponding traditional algorithms and will present, upon completion, a safe call graph.
[1]
Barbara G. Ryder,et al.
Data-flow analysis of program fragments
,
1999,
ESEC/FSE-7.
[2]
Ondrej Lhoták,et al.
Points-to analysis using BDDs
,
2003,
PLDI '03.
[3]
Jens Palsberg,et al.
Scalable propagation-based call graph construction algorithms
,
2000,
OOPSLA '00.
[4]
Ondrej Lhoták,et al.
Comparing call graphs
,
2007,
PASTE '07.
[5]
R Day,et al.
The eclipse open-development platform
,
2008
.
[6]
Amitabh Srivastava,et al.
Unreachable procedures in object-oriented programming
,
1992,
LOPL.
[7]
Amer Diwan,et al.
The DaCapo benchmarks: java benchmarking development and analysis
,
2006,
OOPSLA '06.
[8]
David F. Bacon,et al.
Fast static analysis of C++ virtual function calls
,
1996,
OOPSLA '96.
[9]
Barbara G. Ryder,et al.
Automatic construction of accurate application call graph with library call abstraction for Java: Research Articles
,
2007
.
[10]
David Grove,et al.
Optimization of Object-Oriented Programs Using Static Class Hierarchy Analysis
,
1995,
ECOOP.