public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGraphBuilder implements HeapModel
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.
| Modifier and Type | Class and Description |
|---|---|
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
|
PropagationCallGraphBuilder.ArrayLoadOperator, PropagationCallGraphBuilder.ArrayStoreOperator, PropagationCallGraphBuilder.FilterOperator, PropagationCallGraphBuilder.GetFieldOperator, PropagationCallGraphBuilder.InstanceArrayStoreOperator, PropagationCallGraphBuilder.InstancePutFieldOperator, PropagationCallGraphBuilder.InverseFilterOperator, PropagationCallGraphBuilder.MutableBoolean, PropagationCallGraphBuilder.PutFieldOperator, PropagationCallGraphBuilder.TypedPointerKey| Modifier and Type | Field and Description |
|---|---|
com.ibm.wala.util.MonitorUtil.IProgressMonitor |
monitor |
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
|
assignOperator, callGraph, cha, contextSelector, DEBUG_GENERAL, entrypointCallSites, filterOperator, instanceKeyFactory, inverseFilterOperator, options, pointerKeyFactory, system| Modifier | Constructor and Description |
|---|---|
protected |
SSAPropagationCallGraphBuilder(IMethod abstractRootMethod,
AnalysisOptions options,
IAnalysisCacheView cache,
PointerKeyFactory pointerKeyFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBlockInstructionConstraints(CGNode node,
IRView ir,
SSACFG.BasicBlock b,
SSAPropagationCallGraphBuilder.ConstraintVisitor v,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Add constraints for a particular basic block.
|
protected boolean |
addConstraintsFromNode(CGNode node,
com.ibm.wala.util.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,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Add pointer flow constraints based on instructions in a given node
|
protected void |
addNodePassthruExceptionConstraints(CGNode node,
IRView ir,
DefUse du)
Add constraints to represent the flow of exceptions to the exceptional return value for this
node
|
protected void |
addNodeValueConstraints(CGNode node,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Hook for aubclasses to add pointer flow constraints based on values in a given node
|
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,
IRView ir) |
SSAContextInterpreter |
getCFAContextInterpreter() |
static java.util.List<ProgramCounter> |
getIncomingPEIs(IRView ir,
ISSABasicBlock bb) |
InstanceKey |
getInstanceKeyForPEI(CGNode node,
ProgramCounter instr,
TypeReference type) |
static InstanceKey |
getInstanceKeyForPEI(CGNode node,
ProgramCounter x,
TypeReference type,
InstanceKeyFactory ikFactory) |
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) |
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,
SSAAbstractInvokeInstruction instruction,
InstanceKey[][] invs) |
PointerKey |
getUniqueCatchKey(SSAAbstractInvokeInstruction call,
IRView ir,
CGNode node)
precondition: hasUniqueCatchBlock(call,node,cg)
|
boolean |
hasNoInterestingUses(CGNode node,
int vn,
DefUse du) |
protected static boolean |
hasUniqueCatchBlock(SSAAbstractInvokeInstruction call,
IRView ir) |
protected boolean |
isConstantRef(SymbolTable symbolTable,
int valueNumber) |
protected void |
iterateCrossProduct(CGNode caller,
SSAAbstractInvokeInstruction call,
InstanceKey[][] invariants,
java.util.function.Consumer<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,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) |
addAssignmentsForCatchPointerKey, addConstraintsFromChangedNode, addConstraintsFromNewNodes, assignInstanceToCatch, catches, createEmptyCallGraph, customInit, filterForClass, getAnalysisCache, getCallGraph, getClassHierarchy, getContextInterpreter, getContextSelector, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getInstanceKeyForAllocation, getInstanceKeyForConstant, getInstanceKeyForMetadataObject, getInstanceKeyForMultiNewArray, getInstanceKeys, getInstanceKeysForClass, getJavaLangObject, getMutableInstanceKeysForClass, getOptions, getPointerAnalysis, getPointerKeyFactory, getPointerKeyForArrayContents, getPointerKeyForExceptionalReturnValue, getPointerKeyForInstanceField, getPointerKeyForLocal, getPointerKeyForReturnValue, getPointerKeyForStaticField, getPropagationSystem, getSolver, getSystem, getTargetForCall, haveAlreadyVisited, isJavaLangObject, makeCallGraph, makeCallGraph, makeSystem, markAlreadyVisited, markChanged, markDiscovered, representsNullType, setContextInterpreter, setContextSelector, setInstanceKeys, setPointerKeyFactory, wasChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassHierarchygetInstanceKeyForAllocation, getInstanceKeyForConstant, getInstanceKeyForMetadataObject, getInstanceKeyForMultiNewArraygetFilteredPointerKeyForLocal, getPointerKeyForArrayContents, getPointerKeyForExceptionalReturnValue, getPointerKeyForInstanceField, getPointerKeyForLocal, getPointerKeyForReturnValue, getPointerKeyForStaticFieldpublic static final boolean PERIODIC_WIPE_SOFT_CACHES
public static final int WIPE_SOFT_CACHE_INTERVAL
protected static final boolean SHORT_CIRCUIT_SINGLE_USES
Doesn't play well with pre-transitive solver; turning off for now.
public com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor
protected SSAPropagationCallGraphBuilder(IMethod abstractRootMethod, AnalysisOptions options, IAnalysisCacheView cache, PointerKeyFactory pointerKeyFactory)
public SSAContextInterpreter getCFAContextInterpreter()
public static InstanceKey getInstanceKeyForPEI(CGNode node, ProgramCounter x, TypeReference type, InstanceKeyFactory ikFactory)
java.lang.IllegalArgumentException - if ikFactory is nullprotected boolean addConstraintsFromNode(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
addConstraintsFromNode in class PropagationCallGraphBuildercom.ibm.wala.util.CancelExceptionprotected boolean unconditionallyAddConstraintsFromNode(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
unconditionallyAddConstraintsFromNode in class PropagationCallGraphBuildercom.ibm.wala.util.CancelExceptionprotected SSAPropagationCallGraphBuilder.ConstraintVisitor makeVisitor(CGNode node)
protected void addNodeInstructionConstraints(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected void addNodeValueConstraints(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected void addBlockInstructionConstraints(CGNode node, IRView ir, SSACFG.BasicBlock b, SSAPropagationCallGraphBuilder.ConstraintVisitor v, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected void addNodePassthruExceptionConstraints(CGNode node, IRView ir, DefUse du)
protected static boolean hasUniqueCatchBlock(SSAAbstractInvokeInstruction call, IRView ir)
public PointerKey getUniqueCatchKey(SSAAbstractInvokeInstruction call, IRView ir, CGNode node) throws java.lang.IllegalArgumentException, java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if ir == nulljava.lang.IllegalArgumentException - if call == nullpublic static java.util.List<ProgramCounter> getIncomingPEIs(IRView ir, ISSABasicBlock bb)
java.lang.IllegalArgumentException - if ir is nullprotected void processCallingConstraints(CGNode caller, SSAAbstractInvokeInstruction instruction, CGNode target, InstanceKey[][] constParams, PointerKey uniqueCatchKey)
protected void iterateCrossProduct(CGNode caller, SSAAbstractInvokeInstruction call, InstanceKey[][] invariants, java.util.function.Consumer<InstanceKey[]> f)
protected java.util.Set<CGNode> getTargetsForCall(CGNode caller, SSAAbstractInvokeInstruction instruction, InstanceKey[][] invs)
protected SSAPropagationCallGraphBuilder.InterestingVisitor makeInterestingVisitor(CGNode node, int vn)
public PointerKey getTargetPointerKey(CGNode target, int index)
public boolean contentsAreInvariant(SymbolTable symbolTable, DefUse du, int valueNumber)
protected boolean contentsAreInvariant(SymbolTable symbolTable, DefUse du, int[] valueNumbers)
public InstanceKey[] getInvariantContents(SymbolTable symbolTable, DefUse du, CGNode node, int valueNumber, HeapModel hm)
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 HeapModelpublic static java.util.Set<IClass> getCaughtExceptionTypes(SSAGetCaughtExceptionInstruction instruction, IRView ir)
public InstanceKey getInstanceKeyForPEI(CGNode node, ProgramCounter instr, TypeReference type)
getInstanceKeyForPEI in interface InstanceKeyFactoryprotected IPointsToSolver makeSolver()
makeSolver in class PropagationCallGraphBuilder