Algorithm 5.3 Call-Graph-Construction
Input: Signature of entry methods .
Output: Call Graph CG, a set of call edges.
1:procedure BuildCallGraph()
2: // Work List, containing the methods to be processed
3: // Call Graph, a set of call edges
4: // A set of reachable methods
5:while is not empty do
6:remove from // is a method
7:if then
8:add to
9:for each call site in do
10: Resolve() // Resolve target methods, probably via CHA
11:for each target method in do
12:add to
13:add to
14:end for
15:end for
16:end if
17:end while
18:return
19:end procedure