public abstract class AbstractFlowGraph extends com.ibm.wala.util.graph.labeled.SlowSparseNumberedLabeledGraph<java.lang.Object,IFlowLabel> implements IFlowGraph
IFlowLabels.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<PointerKey,SSAAbstractInvokeInstruction> |
callDefs
Map: LocalPointerKey -> SSAInvokeInstruction.
|
protected java.util.Map<PointerKey,java.util.Set<SSAAbstractInvokeInstruction>> |
callParams
|
protected CallGraph |
cg |
protected IClassHierarchy |
cha |
protected HeapModel |
heapModel |
protected MemoryAccessMap |
mam |
protected java.util.Map<PointerKey,CGNode> |
params
Map: LocalPointerKey -> CGNode.
|
protected java.util.Map<PointerKey,CGNode> |
returns
Map:
LocalPointerKey -> CGNode. |
| Constructor and Description |
|---|
AbstractFlowGraph(MemoryAccessMap mam,
HeapModel heapModel,
IClassHierarchy cha,
CallGraph cg) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExceptionDefConstraints(IR ir,
CGNode node,
java.util.List<ProgramCounter> peis,
PointerKey exceptionVar,
java.util.Set<IClass> catchClasses)
Generate constraints which assign exception values into an exception pointer
|
protected void |
addNodeConstantConstraints(CGNode node,
IR ir)
add constraints for reference constants assigned to vars
|
protected void |
addNodePassthruExceptionConstraints(CGNode node,
IR ir)
Add constraints to represent the flow of exceptions to the exceptional return value for this
node
|
protected void |
addNodesForInvocations(CGNode node,
IR ir)
For each invocation in the method, add nodes for actual parameters and return values
|
static PointerKey |
convertPointerKeyToHeapModel(PointerKey pk,
HeapModel h)
convert a pointer key to one in the memory access map's heap model
|
protected java.util.Iterator<PointerKey> |
getArrayReads(PointerKey arrayRef) |
SSAAbstractInvokeInstruction |
getInstrReturningTo(LocalPointerKey pk)
get the
SSAInvokeInstruction whose return value is assigned to a pointer key. |
java.util.Iterator<SSAAbstractInvokeInstruction> |
getInstrsPassingParam(LocalPointerKey pk) |
java.util.Iterator<PointerKey> |
getReadsOfInstanceField(PointerKey pk,
IField f) |
java.util.Iterator<? extends java.lang.Object> |
getReadsOfStaticField(StaticFieldKey sfk) |
java.util.Iterator<PointerKey> |
getWritesToInstanceField(PointerKey pk,
IField f) |
java.util.Iterator<? extends java.lang.Object> |
getWritesToStaticField(StaticFieldKey sfk) |
boolean |
isParam(LocalPointerKey pk) |
void |
visitPreds(java.lang.Object node,
IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the predecessors of some node.
|
void |
visitSuccs(java.lang.Object node,
IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the successors of some node.
|
copyInto, duplicate, getEdgeManager, getNodeManageraddEdge, edgeString, getDefaultLabel, getEdgeLabels, getPredLabels, getPredNodeCount, getPredNodeNumbers, getPredNodes, getSuccLabels, getSuccNodeCount, getSuccNodeNumbers, getSuccNodes, hasEdge, removeEdgegetMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodesaddEdge, addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSubgraphForNode, getPossibleTargets, getPotentialCallers, hasSubgraphForNodeaddNode, containsNode, getNumberOfNodes, iterator, removeNode, streamaddEdge, getDefaultLabel, getEdgeLabels, getPredLabels, getPredNodeCount, getPredNodes, getPredNodes, getSuccLabels, getSuccNodeCount, getSuccNodes, hasEdge, removeEdgeaddEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdgesprotected final java.util.Map<PointerKey,SSAAbstractInvokeInstruction> callDefs
protected final java.util.Map<PointerKey,java.util.Set<SSAAbstractInvokeInstruction>> callParams
LocalPointerKey -> Set<SSAInvokeInstruction>. If we have
(x, foo()), that means x was passed as a parameter to the call to foo(). The parameter position
is not represented and must be recovered.protected final java.util.Map<PointerKey,CGNode> params
LocalPointerKeyprotected final java.util.Map<PointerKey,CGNode> returns
LocalPointerKey -> CGNode. If we have (x, foo), then x is a return
value of method foo. Must re-discover if x is normal or exceptional return value.protected final MemoryAccessMap mam
protected final HeapModel heapModel
protected final IClassHierarchy cha
protected final CallGraph cg
public AbstractFlowGraph(MemoryAccessMap mam, HeapModel heapModel, IClassHierarchy cha, CallGraph cg)
public void visitSuccs(java.lang.Object node,
IFlowLabel.IFlowLabelVisitor v)
IFlowGraphvisitSuccs in interface IFlowGraphpublic void visitPreds(java.lang.Object node,
IFlowLabel.IFlowLabelVisitor v)
IFlowGraphvisitPreds in interface IFlowGraphprotected void addNodesForInvocations(CGNode node, IR ir)
public boolean isParam(LocalPointerKey pk)
isParam in interface IFlowGraphtrue iff pk is a formal parameterpublic java.util.Iterator<SSAAbstractInvokeInstruction> getInstrsPassingParam(LocalPointerKey pk)
getInstrsPassingParam in interface IFlowGraphSSAInvokeInstructions passing some pointer as a parameterpublic SSAAbstractInvokeInstruction getInstrReturningTo(LocalPointerKey pk)
IFlowGraphSSAInvokeInstruction whose return value is assigned to a pointer key.getInstrReturningTo in interface IFlowGraphnull if no return value is assigned to pkpublic java.util.Iterator<? extends java.lang.Object> getWritesToStaticField(StaticFieldKey sfk) throws java.lang.IllegalArgumentException
getWritesToStaticField in interface IFlowGraphsfk - the static fieldjava.lang.IllegalArgumentException - if sfk == nullpublic java.util.Iterator<? extends java.lang.Object> getReadsOfStaticField(StaticFieldKey sfk) throws java.lang.IllegalArgumentException
getReadsOfStaticField in interface IFlowGraphsfk - the static fieldjava.lang.IllegalArgumentException - if sfk == nullpublic java.util.Iterator<PointerKey> getWritesToInstanceField(PointerKey pk, IField f)
getWritesToInstanceField in interface IFlowGraphpublic static PointerKey convertPointerKeyToHeapModel(PointerKey pk, HeapModel h)
TODO move this somewhere more appropriate
java.lang.UnsupportedOperationException - if it doesn't know how to handle a PointerKeypublic java.util.Iterator<PointerKey> getReadsOfInstanceField(PointerKey pk, IField f)
getReadsOfInstanceField in interface IFlowGraphprotected java.util.Iterator<PointerKey> getArrayReads(PointerKey arrayRef)
protected void addNodePassthruExceptionConstraints(CGNode node, IR ir)
protected void addExceptionDefConstraints(IR ir, CGNode node, java.util.List<ProgramCounter> peis, PointerKey exceptionVar, java.util.Set<IClass> catchClasses)
node - governing nodepeis - list of PEI instructionsexceptionVar - PointerKey representing a pointer to an exception valuecatchClasses - the types "caught" by the exceptionVar