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
Nested ClassesModifier and TypeClassDescriptionprotected classA visitor that generates graph nodes and edges for an IR. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleDemandPointerFlowGraph(CallGraph cg, HeapModel heapModel, MemoryAccessMap fam, IClassHierarchy cha) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBlockInstructionConstraints(CGNode node, ControlFlowGraph<SSAInstruction, ISSABasicBlock> cfg, ISSABasicBlock b, SimpleDemandPointerFlowGraph.StatementVisitor v) Add constraints for a particular basic block.protected voidaddNodeInstructionConstraints(CGNode node, IR ir, DefUse du) Add pointer flow constraints based on instructions in a given nodeprotected voidaddNodePassthruExceptionConstraints(CGNode node, IR ir) Add constraints to represent the flow of exceptions to the exceptional return value for this nodevoidaddSubgraphForNode(CGNode node) protected HeapModelintReturn the number ofimmediate predecessornodes of ngetPredNodeNumbers(Object node) Return anIteratorover the immediate predecessor nodes of nintReturn the number ofimmediate successornodes of this Node in the GraphgetSuccNodeNumbers(Object node) Return an Iterator over the immediate successor nodes of nbooleanhasEdge(PointerKey src, PointerKey dst) makeVisitor(ExplicitCallGraph.ExplicitNode node, IR ir, DefUse du) protected voidMethods inherited from class SlowSparseNumberedGraph
copyInto, duplicate, getEdgeManager, getNodeManager, makeMethods inherited from class AbstractNumberedGraph
getMaxNumber, getNode, getNumber, iterateNodesMethods inherited from class AbstractGraph
addEdge, addNode, containsNode, edgeString, getNumberOfNodes, hasEdge, iterator, nodeString, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EdgeManager
addEdge, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdgesMethods inherited from interface Graph
removeNodeAndEdgesMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface 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:
getPredNodeNumbersin interfaceNumberedEdgeManager<Object>- Overrides:
getPredNodeNumbersin classAbstractNumberedGraph<Object>- Returns:
- the numbers identifying the immediate predecessors of node
- Throws:
UnimplementedError- See Also:
-
getSuccNodeNumbers
- Specified by:
getSuccNodeNumbersin interfaceNumberedEdgeManager<Object>- Overrides:
getSuccNodeNumbersin classAbstractNumberedGraph<Object>- Returns:
- the numbers identifying the immediate successors of node
- Throws:
IllegalArgumentException- See Also:
-
getPredNodeCount
Description copied from interface:EdgeManagerReturn the number ofimmediate predecessornodes of n- Specified by:
getPredNodeCountin interfaceEdgeManager<Object>- Overrides:
getPredNodeCountin classAbstractGraph<Object>- Returns:
- the number of immediate predecessors of n.
- Throws:
UnimplementedError- See Also:
-
getPredNodes
Description copied from interface:EdgeManagerReturn anIteratorover the immediate predecessor nodes of nThis method never returns
null.- Specified by:
getPredNodesin interfaceEdgeManager<Object>- Overrides:
getPredNodesin classAbstractGraph<Object>- Returns:
- an
Iteratorover the immediate predecessor nodes of this Node. - Throws:
IllegalArgumentException- See Also:
-
getSuccNodeCount
Description copied from interface:EdgeManagerReturn the number ofimmediate successornodes of this Node in the Graph- Specified by:
getSuccNodeCountin interfaceEdgeManager<Object>- Overrides:
getSuccNodeCountin classAbstractGraph<Object>- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
- Throws:
UnimplementedError- See Also:
-
getSuccNodes
Description copied from interface:EdgeManagerReturn an Iterator over the immediate successor nodes of nThis method never returns
null.- Specified by:
getSuccNodesin interfaceEdgeManager<Object>- Overrides:
getSuccNodesin 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)
-