com.ibm.wala.ipa.callgraph.impl
Class ExplicitCallGraph.ExplicitNode

java.lang.Object
  extended by com.ibm.wala.util.graph.impl.NodeWithNumber
      extended by com.ibm.wala.ipa.callgraph.impl.BasicCallGraph.NodeImpl
          extended by 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


Field Summary
protected  SparseVector<java.lang.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
protected ExplicitCallGraph.ExplicitNode(IMethod method, Context C)
           
 
Method Summary
 boolean addTarget(CallSiteReference site, CGNode tNode)
          This is for use only by call graph builders ...
protected  boolean addTarget(int pc, CGNode tNode)
           
 void clearAllTargets()
           
 boolean equals(java.lang.Object obj)
           
protected  MutableSharedBitVectorIntSet getAllTargetNumbers()
           
 ExplicitCallGraph getCallGraph()
           
 ControlFlowGraph<SSAInstruction,ISSABasicBlock> getCFG()
           
 DefUse getDU()
           
 IR getIR()
           
protected  int getNumberOfTargets(CallSiteReference site)
           
protected  java.util.Iterator<CallSiteReference> getPossibleSites(CGNode to)
           
protected  IntSet getPossibleTargetNumbers(CallSiteReference site)
           
protected  java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)
           
 int hashCode()
           
 java.util.Iterator<CallSiteReference> iterateCallSites()
           
 java.util.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<java.lang.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.

Constructor Detail

ExplicitCallGraph.ExplicitNode

protected ExplicitCallGraph.ExplicitNode(IMethod method,
                                         Context C)
Parameters:
method -
Method Detail

getPossibleTargets

protected java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)

getPossibleTargetNumbers

protected IntSet getPossibleTargetNumbers(CallSiteReference site)

getPossibleSites

protected java.util.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 interface CGNode
Specified by:
addTarget in class BasicCallGraph.NodeImpl

addTarget

protected boolean addTarget(int pc,
                            CGNode tNode)

removeTarget

public void removeTarget(CGNode target)

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in class BasicCallGraph.NodeImpl
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Specified by:
hashCode in class BasicCallGraph.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 java.util.Iterator<CallSiteReference> iterateCallSites()
Returns:
an Iterator of the call statements that may execute in a given method for a given context

iterateNewSites

public java.util.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()