harpoon.Analysis
Class CallGraph

java.lang.Object
  extended by jpaul.Graphs.DiGraph<HMethod>
      extended by harpoon.Analysis.CallGraph
Direct Known Subclasses:
CallGraph, CallGraphImpl2

public abstract class CallGraph
extends jpaul.Graphs.DiGraph<HMethod>

CallGraph is a general IR-independant interface that for a call graph. IR-specific subclasses (see harpoon.Analysis.Quads.CallGraph) can provide call-site information.

Version:
$Id: CallGraph.java,v 1.9 2005/12/10 17:26:38 salcianu Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Field Summary
protected  jpaul.Graphs.BiDiNavigator<HMethod> navigator
          cached bi-directional navigator
 
Fields inherited from class jpaul.Graphs.DiGraph
CACHING
 
Constructor Summary
CallGraph()
           
 
Method Summary
abstract  Set<HMethod> callableMethods()
          Returns the set of all the methods that can be called in the execution of the program.
abstract  HMethod[] calls(HMethod hm)
          Returns an array containing all possible methods called by method m.
 jpaul.Graphs.BiDiNavigator<HMethod> getBiDiNavigator()
          Returns a bi-directional top-down graph navigator through this callgraph.
 jpaul.Graphs.ForwardNavigator<HMethod> getForwardNavigator()
          Returns a forward-only top-down graph navigator through this callgraph.
 Set<HMethod> getRoots()
           
 Set 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
 

Field Detail

navigator

protected jpaul.Graphs.BiDiNavigator<HMethod> navigator
cached bi-directional navigator

Constructor Detail

CallGraph

public CallGraph()
Method Detail

calls

public abstract HMethod[] calls(HMethod hm)
Returns an array containing all possible methods called by method m. If hm doesn't call any method, return an array of length 0.


callableMethods

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


getRunMethods

public Set getRunMethods()
Returns:
set of all run() methods that may be the bodies of a thread started by the program (optional operation).
Throws:
UnsupportedOperationException - if getRunMethods is not implemented by this.

getRoots

public Set<HMethod> getRoots()
Specified by:
getRoots in class jpaul.Graphs.DiGraph<HMethod>

getBiDiNavigator

public jpaul.Graphs.BiDiNavigator<HMethod> getBiDiNavigator()
Returns a bi-directional top-down graph navigator through this callgraph. Result is internally cached.

Overrides:
getBiDiNavigator in class jpaul.Graphs.DiGraph<HMethod>

getForwardNavigator

public jpaul.Graphs.ForwardNavigator<HMethod> getForwardNavigator()
Returns a forward-only top-down graph navigator through this callgraph.

Overrides:
getForwardNavigator in class jpaul.Graphs.DiGraph<HMethod>