Package com.ibm.wala.ipa.callgraph.cha
Class CHACallGraph
- java.lang.Object
-
- com.ibm.wala.util.graph.AbstractGraph<T>
-
- com.ibm.wala.util.graph.AbstractNumberedGraph<CGNode>
-
- com.ibm.wala.ipa.callgraph.impl.BasicCallGraph<CHAContextInterpreter>
-
- com.ibm.wala.ipa.callgraph.cha.CHACallGraph
-
- All Implemented Interfaces:
CallGraph
,EdgeManager<CGNode>
,Graph<CGNode>
,NodeManager<CGNode>
,NumberedEdgeManager<CGNode>
,NumberedGraph<CGNode>
,NumberedNodeManager<CGNode>
,Iterable<CGNode>
public class CHACallGraph extends BasicCallGraph<CHAContextInterpreter>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.wala.ipa.callgraph.impl.BasicCallGraph
BasicCallGraph.Key, BasicCallGraph.NodeImpl
-
-
Field Summary
-
Fields inherited from class com.ibm.wala.ipa.callgraph.impl.BasicCallGraph
mr2Nodes
-
-
Constructor Summary
Constructors Constructor Description CHACallGraph(IClassHierarchy cha)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CGNode
findOrCreateNode(IMethod method, Context C)
Use with extreme care.IClassHierarchy
getClassHierarchy()
protected NumberedEdgeManager<CGNode>
getEdgeManager()
int
getNumberOfTargets(CGNode node, CallSiteReference site)
Iterator<CallSiteReference>
getPossibleSites(CGNode src, CGNode target)
Set<CGNode>
getPossibleTargets(CGNode node, CallSiteReference site)
Return the set of CGNodes that represent possible targets of a particular call site from a particular nodevoid
init(Iterable<Entrypoint> entrypoints)
protected CGNode
makeFakeRootNode()
protected CGNode
makeFakeWorldClinitNode()
-
Methods inherited from class com.ibm.wala.ipa.callgraph.impl.BasicCallGraph
containsNode, getEntrypointNodes, getFakeRootNode, getFakeWorldClinitNode, getInterpreter, getNode, getNode, getNodeManager, getNodes, getNumberOfNodes, init, iterator, registerEntrypoint, registerNode, removeNodeAndEdges, setInterpreter, summarizeByPackage, toString
-
Methods inherited from class com.ibm.wala.util.graph.AbstractNumberedGraph
getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodes
-
Methods inherited from class com.ibm.wala.util.graph.AbstractGraph
addEdge, addNode, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeOutgoingEdges
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, removeNode
-
Methods inherited from interface com.ibm.wala.util.graph.NumberedEdgeManager
getPredNodeNumbers, getSuccNodeNumbers
-
Methods inherited from interface com.ibm.wala.util.graph.NumberedNodeManager
getMaxNumber, getNode, getNumber, iterateNodes
-
-
-
-
Constructor Detail
-
CHACallGraph
public CHACallGraph(IClassHierarchy cha)
-
-
Method Detail
-
init
public void init(Iterable<Entrypoint> entrypoints) throws CancelException
- Throws:
CancelException
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Returns:
- the governing class hierarchy for this call graph
-
getPossibleTargets
public Set<CGNode> getPossibleTargets(CGNode node, CallSiteReference site)
Description copied from interface:CallGraph
Return the set of CGNodes that represent possible targets of a particular call site from a particular node
-
getNumberOfTargets
public int getNumberOfTargets(CGNode node, CallSiteReference site)
- Returns:
- the number of nodes that the call site may dispatch to
-
getPossibleSites
public Iterator<CallSiteReference> getPossibleSites(CGNode src, CGNode target)
- Returns:
- iterator of CallSiteReference, the call sites in a node that might dispatch to the target node.
-
makeFakeRootNode
protected CGNode makeFakeRootNode() throws CancelException
- Specified by:
makeFakeRootNode
in classBasicCallGraph<CHAContextInterpreter>
- Throws:
CancelException
-
makeFakeWorldClinitNode
protected CGNode makeFakeWorldClinitNode() throws CancelException
- Specified by:
makeFakeWorldClinitNode
in classBasicCallGraph<CHAContextInterpreter>
- Throws:
CancelException
-
findOrCreateNode
public CGNode findOrCreateNode(IMethod method, Context C) throws CancelException
Description copied from class:BasicCallGraph
Use with extreme care.- Specified by:
findOrCreateNode
in classBasicCallGraph<CHAContextInterpreter>
- Throws:
CancelException
- TODO
-
getEdgeManager
protected NumberedEdgeManager<CGNode> getEdgeManager()
- Specified by:
getEdgeManager
in classAbstractNumberedGraph<CGNode>
- Returns:
- the object which manages edges in the graph
-
-