Class SimpleDemandPointerFlowGraph
java.lang.Object
com.ibm.wala.util.graph.AbstractGraph<Object>
com.ibm.wala.util.graph.AbstractNumberedGraph<Object>
com.ibm.wala.util.graph.impl.SlowSparseNumberedGraph<Object>
com.ibm.wala.demandpa.flowgraph.SimpleDemandPointerFlowGraph
- All Implemented Interfaces:
EdgeManager<Object>
,Graph<Object>
,NodeManager<Object>
,NumberedEdgeManager<Object>
,NumberedGraph<Object>
,NumberedNodeManager<Object>
,Serializable
,Iterable<Object>
The nodes in this graph are PointerKeys corresponding to local variables and static fields,
InstanceKeys, and FieldRefs (see below).
This graph is constructed on-demand during a traversal.
The edges represent
- flow from local -> local representing assignment (i.e. phi,pi)
- flow from instancekey -> local for news
- flow from formal -> actual parameter
- flow from return value -> local
- match edges
- local -> local edges representing loads/stores (e.g. x = y.f will have a edge x->y, labelled with f) for a getstatic x = Y.f, we have an edge from x -> Y.f.
Edges carry labels if they arise from loads/stores, or calls
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
A visitor that generates graph nodes and edges for an IR. -
Constructor Summary
ConstructorDescriptionSimpleDemandPointerFlowGraph
(CallGraph cg, HeapModel heapModel, MemoryAccessMap fam, IClassHierarchy cha) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addBlockInstructionConstraints
(CGNode node, ControlFlowGraph<SSAInstruction, ISSABasicBlock> cfg, ISSABasicBlock b, SimpleDemandPointerFlowGraph.StatementVisitor v) Add constraints for a particular basic block.protected void
addNodeInstructionConstraints
(CGNode node, IR ir, DefUse du) Add pointer flow constraints based on instructions in a given nodeprotected void
addNodePassthruExceptionConstraints
(CGNode node, IR ir) Add constraints to represent the flow of exceptions to the exceptional return value for this nodevoid
addSubgraphForNode
(CGNode node) protected HeapModel
int
Return the number ofimmediate predecessor
nodes of ngetPredNodeNumbers
(Object node) Return anIterator
over the immediate predecessor nodes of nint
Return the number ofimmediate successor
nodes of this Node in the GraphgetSuccNodeNumbers
(Object node) Return an Iterator over the immediate successor nodes of nboolean
hasEdge
(PointerKey src, PointerKey dst) makeVisitor
(ExplicitCallGraph.ExplicitNode node, IR ir, DefUse du) protected void
Methods inherited from class com.ibm.wala.util.graph.impl.SlowSparseNumberedGraph
copyInto, duplicate, getEdgeManager, getNodeManager, make
Methods inherited from class com.ibm.wala.util.graph.AbstractNumberedGraph
getMaxNumber, getNode, getNumber, iterateNodes
Methods inherited from class com.ibm.wala.util.graph.AbstractGraph
addEdge, addNode, containsNode, edgeString, getNumberOfNodes, hasEdge, iterator, nodeString, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toString
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, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
Methods inherited from interface com.ibm.wala.util.graph.Graph
removeNodeAndEdges
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode, stream
-
Constructor Details
-
SimpleDemandPointerFlowGraph
public SimpleDemandPointerFlowGraph(CallGraph cg, HeapModel heapModel, MemoryAccessMap fam, IClassHierarchy cha)
-
-
Method Details
-
addSubgraphForNode
-
getHeapModel
- Returns:
- Returns the heapModel.
-
getPredNodeNumbers
- Specified by:
getPredNodeNumbers
in interfaceNumberedEdgeManager<Object>
- Overrides:
getPredNodeNumbers
in classAbstractNumberedGraph<Object>
- Returns:
- the numbers identifying the immediate predecessors of node
- Throws:
UnimplementedError
- See Also:
-
getSuccNodeNumbers
- Specified by:
getSuccNodeNumbers
in interfaceNumberedEdgeManager<Object>
- Overrides:
getSuccNodeNumbers
in classAbstractNumberedGraph<Object>
- Returns:
- the numbers identifying the immediate successors of node
- Throws:
IllegalArgumentException
- See Also:
-
getPredNodeCount
Description copied from interface:EdgeManager
Return the number ofimmediate predecessor
nodes of n- Specified by:
getPredNodeCount
in interfaceEdgeManager<Object>
- Overrides:
getPredNodeCount
in classAbstractGraph<Object>
- Returns:
- the number of immediate predecessors of n.
- Throws:
UnimplementedError
- See Also:
-
getPredNodes
Description copied from interface:EdgeManager
Return anIterator
over the immediate predecessor nodes of nThis method never returns
null
.- Specified by:
getPredNodes
in interfaceEdgeManager<Object>
- Overrides:
getPredNodes
in classAbstractGraph<Object>
- Returns:
- an
Iterator
over the immediate predecessor nodes of this Node. - Throws:
IllegalArgumentException
- See Also:
-
getSuccNodeCount
Description copied from interface:EdgeManager
Return the number ofimmediate successor
nodes of this Node in the Graph- Specified by:
getSuccNodeCount
in interfaceEdgeManager<Object>
- Overrides:
getSuccNodeCount
in classAbstractGraph<Object>
- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
- Throws:
UnimplementedError
- See Also:
-
getSuccNodes
Description copied from interface:EdgeManager
Return an Iterator over the immediate successor nodes of nThis method never returns
null
.- Specified by:
getSuccNodes
in interfaceEdgeManager<Object>
- Overrides:
getSuccNodes
in classAbstractGraph<Object>
- Returns:
- an Iterator over the immediate successor nodes of n
- See Also:
-
hasEdge
-
unconditionallyAddConstraintsFromNode
-
addNodePassthruExceptionConstraints
-
addNodeInstructionConstraints
-
addBlockInstructionConstraints
protected void addBlockInstructionConstraints(CGNode node, ControlFlowGraph<SSAInstruction, ISSABasicBlock> cfg, ISSABasicBlock b, SimpleDemandPointerFlowGraph.StatementVisitor v) Add constraints for a particular basic block. -
makeVisitor
protected SimpleDemandPointerFlowGraph.StatementVisitor makeVisitor(ExplicitCallGraph.ExplicitNode node, IR ir, DefUse du)
-