harpoon.Analysis.Quads
Class CallGraphImpl2

java.lang.Object
  extended by jpaul.Graphs.DiGraph<HMethod>
      extended by harpoon.Analysis.CallGraph
          extended by harpoon.Analysis.Quads.CallGraphImpl2

public class CallGraphImpl2
extends CallGraph

CallGraphImpl2 constructs a simple directed call graph. This version pays closer attention to types for a more precise result. To quantify this a bit, the standard CallGraphImpl yields a 510-node call graph on the "Hello, World" program, compared to the 370-node graph that CallGraphImpl2 gives you.

CallGraphImpl2 only works on SSI form.

Version:
$Id: CallGraphImpl2.java,v 1.7 2004/02/08 03:20:10 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Field Summary
 
Fields inherited from class harpoon.Analysis.CallGraph
navigator
 
Fields inherited from class jpaul.Graphs.DiGraph
CACHING
 
Constructor Summary
CallGraphImpl2(ClassHierarchy ch, HCodeFactory hcf)
          Creates a CallGraph using the specified ClassHierarchy.
 
Method Summary
 Set callableMethods()
          Returns the set of all the methods that can be called in the execution of the program.
 HMethod[] calls(CALL cs, ReachingDefs rd, ExactTypeMap etm)
          Return a list of all possible methods called by this method at a particular call site.
 HMethod[] calls(HMethod m)
          Return a list of all possible methods called by this method.
 
Methods inherited from class harpoon.Analysis.CallGraph
getBiDiNavigator, getForwardNavigator, getRoots, getRunMethods
 
Methods inherited from class jpaul.Graphs.DiGraph
constructBiDiNavigator, dfs, dfs2, diGraph, diGraph, findPath, findPath, forAllVertices, getComponentDiGraph, numArcs, numVertices, reverseDiGraph, subDiGraph, toString, transitivePred, transitivePred, transitiveSucc, transitiveSucc, union, vertices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallGraphImpl2

public CallGraphImpl2(ClassHierarchy ch,
                      HCodeFactory hcf)
Creates a CallGraph using the specified ClassHierarchy. hcf must be a code factory that generates quad-ssi form.

Method Detail

calls

public HMethod[] calls(HMethod m)
Return a list of all possible methods called by this method.

Specified by:
calls in class CallGraph

calls

public HMethod[] calls(CALL cs,
                       ReachingDefs rd,
                       ExactTypeMap etm)
Return a list of all possible methods called by this method at a particular call site.


callableMethods

public Set callableMethods()
Returns the set of all the methods that can be called in the execution of the program.

Specified by:
callableMethods in class CallGraph