|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder
public abstract class SSAPropagationCallGraphBuilder
This abstract base class provides the general algorithm for a call graph builder that relies on propagation through an iterative dataflow solver, and constraints generated by statements in SSA form. TODO: This implementation currently keeps all points to sets live ... even those for local variables that do not span interprocedural boundaries. This may be too space-inefficient .. we can consider recomputing local sets on demand.
| Nested Class Summary | |
|---|---|
protected static class |
SSAPropagationCallGraphBuilder.ConstraintVisitor
A visitor that generates constraints based on statements in SSA form. |
protected static class |
SSAPropagationCallGraphBuilder.InterestingVisitor
sets bingo to true when it visits an interesting instruction |
| Field Summary | |
|---|---|
static boolean |
PERIODIC_WIPE_SOFT_CACHES
Should we periodically clear out soft reference caches in an attempt to help the GC? |
protected static boolean |
SHORT_CIRCUIT_SINGLE_USES
An optimization: if we can locally determine that a particular pointer p has exactly one use, then we don't actually create the points-to-set for p, but instead short-circuit by propagating the final solution to the unique use. |
static int |
WIPE_SOFT_CACHE_INTERVAL
Interval which defines the period to clear soft reference caches |
| Fields inherited from class com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder |
|---|
assignOperator, callGraph, cha, contextSelector, DEBUG_GENERAL, entrypointCallSites, filterOperator, instanceKeyFactory, inverseFilterOperator, options, pointerKeyFactory, system |
| Constructor Summary | |
|---|---|
protected |
SSAPropagationCallGraphBuilder(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache,
PointerKeyFactory pointerKeyFactory)
|
| Method Summary | |
|---|---|
protected void |
addBlockInstructionConstraints(CGNode node,
ControlFlowGraph<SSAInstruction,ISSABasicBlock> cfg,
SSACFG.BasicBlock b,
SSAPropagationCallGraphBuilder.ConstraintVisitor v,
MonitorUtil.IProgressMonitor monitor)
Add constraints for a particular basic block. |
protected boolean |
addConstraintsFromNode(CGNode node,
MonitorUtil.IProgressMonitor monitor)
Visit all instructions in a node, and add dataflow constraints induced by each statement in the SSA form. |
protected void |
addNodeInstructionConstraints(CGNode node,
MonitorUtil.IProgressMonitor monitor)
Add pointer flow constraints based on instructions in a given node |
protected void |
addNodePassthruExceptionConstraints(CGNode node,
IR ir,
DefUse du)
Add constraints to represent the flow of exceptions to the exceptional return value for this node |
protected boolean |
contentsAreInvariant(SymbolTable symbolTable,
DefUse du,
int valueNumber)
A value is "invariant" if we can figure out the instances it can ever point to locally, without resorting to propagation. |
protected boolean |
contentsAreInvariant(SymbolTable symbolTable,
DefUse du,
int[] valueNumbers)
|
static java.util.Set<IClass> |
getCaughtExceptionTypes(SSAGetCaughtExceptionInstruction instruction,
IR ir)
|
SSAContextInterpreter |
getCFAContextInterpreter()
|
static java.util.List<ProgramCounter> |
getIncomingPEIs(IR ir,
ISSABasicBlock bb)
|
InstanceKey |
getInstanceKeyForPEI(CGNode node,
ProgramCounter instr,
TypeReference type)
|
static InstanceKey |
getInstanceKeyForPEI(CGNode node,
ProgramCounter x,
TypeReference type,
InstanceKeyFactory ikFactory)
|
protected InstanceKey[] |
getInvariantContents(SymbolTable symbolTable,
DefUse du,
CGNode node,
int valueNumber,
HeapModel hm)
precondition:contentsAreInvariant(valueNumber) |
protected InstanceKey[] |
getInvariantContents(SymbolTable symbolTable,
DefUse du,
CGNode node,
int valueNumber,
HeapModel hm,
boolean ensureIndexes)
|
protected PointerKey |
getTargetPointerKey(CGNode target,
int index)
TODO: enhance this logic using type inference TODO!!!: enhance filtering to consider concrete types, not just cones. |
protected java.util.Set<CGNode> |
getTargetsForCall(CGNode caller,
CallSiteReference site)
|
PointerKey |
getUniqueCatchKey(SSAAbstractInvokeInstruction call,
IR ir,
CGNode node)
precondition: hasUniqueCatchBlock(call,node,cg) |
boolean |
hasNoInterestingUses(CGNode node,
int vn,
DefUse du)
|
protected static boolean |
hasUniqueCatchBlock(SSAAbstractInvokeInstruction call,
IR ir)
|
protected boolean |
isConstantRef(SymbolTable symbolTable,
int valueNumber)
|
protected void |
iterateCrossProduct(CGNode caller,
CallSiteReference site,
IntSet parameters,
VoidFunction<InstanceKey[]> f)
|
java.util.Iterator<PointerKey> |
iteratePointerKeys()
|
protected SSAPropagationCallGraphBuilder.InterestingVisitor |
makeInterestingVisitor(CGNode node,
int vn)
|
protected IPointsToSolver |
makeSolver()
|
protected SSAPropagationCallGraphBuilder.ConstraintVisitor |
makeVisitor(CGNode node)
|
protected void |
processCallingConstraints(CGNode caller,
SSAAbstractInvokeInstruction instruction,
CGNode target,
InstanceKey[][] constParams,
PointerKey uniqueCatchKey)
|
protected boolean |
unconditionallyAddConstraintsFromNode(CGNode node,
MonitorUtil.IProgressMonitor monitor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.ibm.wala.ipa.callgraph.propagation.HeapModel |
|---|
getClassHierarchy |
| Methods inherited from interface com.ibm.wala.ipa.callgraph.propagation.InstanceKeyFactory |
|---|
getInstanceKeyForAllocation, getInstanceKeyForClassObject, getInstanceKeyForConstant, getInstanceKeyForMultiNewArray |
| Methods inherited from interface com.ibm.wala.ipa.callgraph.propagation.PointerKeyFactory |
|---|
getFilteredPointerKeyForLocal, getPointerKeyForArrayContents, getPointerKeyForExceptionalReturnValue, getPointerKeyForInstanceField, getPointerKeyForLocal, getPointerKeyForReturnValue, getPointerKeyForStaticField |
| Field Detail |
|---|
public static final boolean PERIODIC_WIPE_SOFT_CACHES
public static final int WIPE_SOFT_CACHE_INTERVAL
protected static final boolean SHORT_CIRCUIT_SINGLE_USES
| Constructor Detail |
|---|
protected SSAPropagationCallGraphBuilder(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache,
PointerKeyFactory pointerKeyFactory)
| Method Detail |
|---|
public SSAContextInterpreter getCFAContextInterpreter()
public static InstanceKey getInstanceKeyForPEI(CGNode node,
ProgramCounter x,
TypeReference type,
InstanceKeyFactory ikFactory)
node - x - type -
java.lang.IllegalArgumentException - if ikFactory is null
protected boolean addConstraintsFromNode(CGNode node,
MonitorUtil.IProgressMonitor monitor)
throws CancelException
addConstraintsFromNode in class PropagationCallGraphBuilderCancelExceptioncom.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder#addConstraintsFromNode(com.ibm.wala.ipa.callgraph.CGNode)
protected boolean unconditionallyAddConstraintsFromNode(CGNode node,
MonitorUtil.IProgressMonitor monitor)
throws CancelException
unconditionallyAddConstraintsFromNode in class PropagationCallGraphBuilderCancelExceptionprotected SSAPropagationCallGraphBuilder.ConstraintVisitor makeVisitor(CGNode node)
protected void addNodeInstructionConstraints(CGNode node,
MonitorUtil.IProgressMonitor monitor)
throws CancelException
CancelException
protected void addBlockInstructionConstraints(CGNode node,
ControlFlowGraph<SSAInstruction,ISSABasicBlock> cfg,
SSACFG.BasicBlock b,
SSAPropagationCallGraphBuilder.ConstraintVisitor v,
MonitorUtil.IProgressMonitor monitor)
throws CancelException
CancelException
protected void addNodePassthruExceptionConstraints(CGNode node,
IR ir,
DefUse du)
node - ir -
protected static boolean hasUniqueCatchBlock(SSAAbstractInvokeInstruction call,
IR ir)
public PointerKey getUniqueCatchKey(SSAAbstractInvokeInstruction call,
IR ir,
CGNode node)
throws java.lang.IllegalArgumentException,
java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if ir == null
java.lang.IllegalArgumentException - if call == null
public static java.util.List<ProgramCounter> getIncomingPEIs(IR ir,
ISSABasicBlock bb)
java.lang.IllegalArgumentException - if ir is null
protected void processCallingConstraints(CGNode caller,
SSAAbstractInvokeInstruction instruction,
CGNode target,
InstanceKey[][] constParams,
PointerKey uniqueCatchKey)
protected void iterateCrossProduct(CGNode caller,
CallSiteReference site,
IntSet parameters,
VoidFunction<InstanceKey[]> f)
protected java.util.Set<CGNode> getTargetsForCall(CGNode caller,
CallSiteReference site)
public boolean hasNoInterestingUses(CGNode node,
int vn,
DefUse du)
protected SSAPropagationCallGraphBuilder.InterestingVisitor makeInterestingVisitor(CGNode node,
int vn)
protected PointerKey getTargetPointerKey(CGNode target,
int index)
target -
protected boolean contentsAreInvariant(SymbolTable symbolTable,
DefUse du,
int valueNumber)
valueNumber -
protected boolean contentsAreInvariant(SymbolTable symbolTable,
DefUse du,
int[] valueNumbers)
protected InstanceKey[] getInvariantContents(SymbolTable symbolTable,
DefUse du,
CGNode node,
int valueNumber,
HeapModel hm)
valueNumber -
protected InstanceKey[] getInvariantContents(SymbolTable symbolTable,
DefUse du,
CGNode node,
int valueNumber,
HeapModel hm,
boolean ensureIndexes)
protected boolean isConstantRef(SymbolTable symbolTable,
int valueNumber)
public java.util.Iterator<PointerKey> iteratePointerKeys()
iteratePointerKeys in interface HeapModel
public static java.util.Set<IClass> getCaughtExceptionTypes(SSAGetCaughtExceptionInstruction instruction,
IR ir)
public InstanceKey getInstanceKeyForPEI(CGNode node,
ProgramCounter instr,
TypeReference type)
getInstanceKeyForPEI in interface InstanceKeyFactoryprotected IPointsToSolver makeSolver()
makeSolver in class PropagationCallGraphBuilder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||