public abstract class AbstractFlowGraph extends com.ibm.wala.util.graph.labeled.SlowSparseNumberedLabeledGraph<Object,IFlowLabel> implements IFlowGraph
IFlowLabels.| Modifier and Type | Field and Description |
|---|---|
protected Map<PointerKey,SSAAbstractInvokeInstruction> |
callDefs
Map: LocalPointerKey -> SSAInvokeInstruction.
|
protected Map<PointerKey,Set<SSAAbstractInvokeInstruction>> |
callParams
Map:
LocalPointerKey -> Set<SSAInvokeInstruction>. |
protected CallGraph |
cg |
protected IClassHierarchy |
cha |
protected HeapModel |
heapModel |
protected MemoryAccessMap |
mam |
protected Map<PointerKey,CGNode> |
params
Map: LocalPointerKey -> CGNode.
|
protected 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,
List<ProgramCounter> peis,
PointerKey exceptionVar,
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
TODO move this somewhere more appropriate
|
protected Iterator<PointerKey> |
getArrayReads(PointerKey arrayRef) |
SSAAbstractInvokeInstruction |
getInstrReturningTo(LocalPointerKey pk)
get the
SSAInvokeInstruction whose return value is assigned to a pointer key. |
Iterator<SSAAbstractInvokeInstruction> |
getInstrsPassingParam(LocalPointerKey pk) |
Iterator<PointerKey> |
getReadsOfInstanceField(PointerKey pk,
IField f) |
Iterator<? extends Object> |
getReadsOfStaticField(StaticFieldKey sfk) |
Iterator<PointerKey> |
getWritesToInstanceField(PointerKey pk,
IField f) |
Iterator<? extends Object> |
getWritesToStaticField(StaticFieldKey sfk) |
boolean |
isParam(LocalPointerKey pk) |
void |
visitPreds(Object node,
IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the predecessors of some node.
|
void |
visitSuccs(Object node,
IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the successors of some node.
|
copyInto, duplicate, getEdgeManager, getNodeManageraddEdge, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSubgraphForNode, getPossibleTargets, getPotentialCallers, hasSubgraphForNodeaddNode, containsNode, getNumberOfNodes, iterator, removeNodeprotected final Map<PointerKey,SSAAbstractInvokeInstruction> callDefs
protected final Map<PointerKey,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 Map<PointerKey,CGNode> params
LocalPointerKeyprotected final 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(Object node, IFlowLabel.IFlowLabelVisitor v)
IFlowGraphvisitSuccs in interface IFlowGraphpublic void visitPreds(Object node, IFlowLabel.IFlowLabelVisitor v)
IFlowGraphvisitPreds in interface IFlowGraphprotected void addNodesForInvocations(CGNode node, IR ir)
node - public boolean isParam(LocalPointerKey pk)
isParam in interface IFlowGraphtrue iff pk is a formal parameterpublic 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 Iterator<? extends Object> getWritesToStaticField(StaticFieldKey sfk) throws IllegalArgumentException
getWritesToStaticField in interface IFlowGraphsfk - the static fieldIllegalArgumentException - if sfk == nullpublic Iterator<? extends Object> getReadsOfStaticField(StaticFieldKey sfk) throws IllegalArgumentException
getReadsOfStaticField in interface IFlowGraphsfk - the static fieldIllegalArgumentException - if sfk == nullpublic Iterator<PointerKey> getWritesToInstanceField(PointerKey pk, IField f)
getWritesToInstanceField in interface IFlowGraphpublic static PointerKey convertPointerKeyToHeapModel(PointerKey pk, HeapModel h)
UnsupportedOperationException - if it doesn't know how to handle a PointerKeypublic Iterator<PointerKey> getReadsOfInstanceField(PointerKey pk, IField f)
getReadsOfInstanceField in interface IFlowGraphprotected Iterator<PointerKey> getArrayReads(PointerKey arrayRef)
protected void addNodePassthruExceptionConstraints(CGNode node, IR ir)
protected void addExceptionDefConstraints(IR ir, CGNode node, List<ProgramCounter> peis, PointerKey exceptionVar, Set<IClass> catchClasses)
node - governing nodepeis - list of PEI instructionsexceptionVar - PointerKey representing a pointer to an exception valuecatchClasses - the types "caught" by the exceptionVarCopyright © 2015. All rights reserved.