Package com.ibm.wala.ipa.callgraph.impl
Class ExplicitCallGraph.ExplicitNode
- java.lang.Object
-
- com.ibm.wala.util.graph.impl.NodeWithNumber
-
- com.ibm.wala.ipa.callgraph.impl.BasicCallGraph.NodeImpl
-
- com.ibm.wala.ipa.callgraph.impl.ExplicitCallGraph.ExplicitNode
-
- All Implemented Interfaces:
CGNode
,ContextItem
,IClassHierarchyDweller
,INodeWithNumber
- Direct Known Subclasses:
AstCallGraph.AstCGNode
,DelegatingExplicitCallGraph.DelegatingCGNode
- Enclosing class:
- ExplicitCallGraph
public class ExplicitCallGraph.ExplicitNode extends BasicCallGraph.NodeImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected SparseVector<Object>
targets
A Mapping from call site program counter (int) -> Object, where Object is a CGNode if we've discovered exactly one target for the site, or an IntSet of node numbers if we've discovered more than one target for the site.-
Fields inherited from class com.ibm.wala.ipa.callgraph.impl.BasicCallGraph.NodeImpl
method
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExplicitNode(IMethod method, Context C)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
addTarget(int pc, CGNode tNode)
boolean
addTarget(CallSiteReference site, CGNode tNode)
This is for use only by call graph builders ...void
clearAllTargets()
boolean
equals(Object obj)
protected MutableSharedBitVectorIntSet
getAllTargetNumbers()
ExplicitCallGraph
getCallGraph()
ControlFlowGraph<SSAInstruction,ISSABasicBlock>
getCFG()
DefUse
getDU()
IR
getIR()
protected int
getNumberOfTargets(CallSiteReference site)
protected Iterator<CallSiteReference>
getPossibleSites(CGNode to)
protected IntSet
getPossibleTargetNumbers(CallSiteReference site)
protected Set<CGNode>
getPossibleTargets(CallSiteReference site)
int
hashCode()
Iterator<CallSiteReference>
iterateCallSites()
Iterator<NewSiteReference>
iterateNewSites()
void
removeTarget(CGNode target)
-
Methods inherited from class com.ibm.wala.ipa.callgraph.impl.BasicCallGraph.NodeImpl
getClassHierarchy, getContext, getMethod, toString
-
Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
-
-
-
-
Field Detail
-
targets
protected final SparseVector<Object> targets
A Mapping from call site program counter (int) -> Object, where Object is a CGNode if we've discovered exactly one target for the site, or an IntSet of node numbers if we've discovered more than one target for the site.
-
-
Method Detail
-
getPossibleTargets
protected Set<CGNode> getPossibleTargets(CallSiteReference site)
-
getPossibleTargetNumbers
protected IntSet getPossibleTargetNumbers(CallSiteReference site)
-
getPossibleSites
protected Iterator<CallSiteReference> getPossibleSites(CGNode to)
-
getNumberOfTargets
protected int getNumberOfTargets(CallSiteReference site)
-
addTarget
public boolean addTarget(CallSiteReference site, CGNode tNode)
Description copied from interface:CGNode
This is for use only by call graph builders ... not by the general public. Clients should not use this. Record that a particular call site might resolve to a call to a particular target node. Returns true if this is a new target- Specified by:
addTarget
in interfaceCGNode
- Specified by:
addTarget
in classBasicCallGraph.NodeImpl
-
addTarget
protected boolean addTarget(int pc, CGNode tNode)
-
removeTarget
public void removeTarget(CGNode target)
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in classBasicCallGraph.NodeImpl
- See Also:
Object.equals(Object)
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classBasicCallGraph.NodeImpl
- See Also:
Object.hashCode()
-
getAllTargetNumbers
protected MutableSharedBitVectorIntSet getAllTargetNumbers()
-
clearAllTargets
public void clearAllTargets()
-
getIR
public IR getIR()
- Returns:
- the "default" IR for this node used by the governing call graph
-
getDU
public DefUse getDU()
- Returns:
- DefUse for the "default" IR for this node used by the governing call graph
-
getCallGraph
public ExplicitCallGraph getCallGraph()
-
iterateCallSites
public Iterator<CallSiteReference> iterateCallSites()
- Returns:
- an Iterator of the call statements that may execute in a given method for a given context
-
iterateNewSites
public Iterator<NewSiteReference> iterateNewSites()
- Returns:
- an Iterator of the types that may be allocated by a given method in a given context.
-
getCFG
public ControlFlowGraph<SSAInstruction,ISSABasicBlock> getCFG()
-
-