Class PropagationSystem
java.lang.Object
com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver<PointsToSetVariable>
com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver<PointsToSetVariable>
com.ibm.wala.ipa.callgraph.propagation.PropagationSystem
- All Implemented Interfaces:
FixedPointConstants, IFixedPointSolver<PointsToSetVariable>, VerboseAction
System of constraints that define propagation for call graph construction
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractFixedPointSolver
AbstractFixedPointSolver.Statement -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CallGraphGoverning call graph;protected final MutableMapping<InstanceKey> bijection from InstanceKey <=> Integerprotected final PointsToMapobject that tracks points-to setsFields inherited from class AbstractFixedPointSolver
DEFAULT_PERIODIC_MAINTENANCE_INTERVAL, DEFAULT_VERBOSE_INTERVAL, verbose, workListModifier and TypeFieldDescriptionstatic final intstatic final intstatic final booleanprotected Worklistworklist for the iterative solverFields inherited from interface FixedPointConstants
CHANGED, CHANGED_AND_FIXED, CHANGED_MASK, FIXED_MASK, NOT_CHANGED, NOT_CHANGED_AND_FIXED, SIDE_EFFECT_MASKModifier and TypeFieldDescriptionstatic final byteA return value which indicates that a lhs has changed, and the statement might need to be evaluated again.static final byteA return value which indicates that lhs has changed, and the statement need not be evaluated again.static final intThe bit-mask which defines the "CHANGED" flagstatic final intThe bit-mask which defines the "FIXED" flagstatic final byteA return value which indicates that lhs has not changed, and the statement might need to be evaluated again.static final byteA return value which indicates that lhs has not changed, and the statement need not be evaluated again.static final intThe bit-mask which defines the "SIDE EFFECT" flag -
Constructor Summary
ConstructorsConstructorDescriptionPropagationSystem(CallGraph cg, PointerKeyFactory pointerKeyFactory, InstanceKeyFactory instanceKeyFactory) -
Method Summary
Modifier and TypeMethodDescriptionintIf key is unified, returns the representativeNOTE: do not use this method unless you really know what you are doing.intgetInstanceKey(int i) getInstanceKeysForClass(IClass klass) intintwarning: this is _real_ slow; don't use it anywhere performance criticalintsubclasses should override as desired.intsubclasses should override as desired.protected voidInitialize all lattice vars in the system.protected voidInitialize the work list for iteration.jbooleanisImplicit(PointerKey result) booleanbooleanisUnified(PointerKey result) protected PointsToSetVariable[]makeStmtRHS(int size) booleannewConstraint(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs) booleannewConstraint(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs1, PointerKey rhs2) booleannewConstraint(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) NB: this is idempotent ...booleannewConstraint(PointerKey lhs, InstanceKey value) booleannewFieldRead(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) booleannewFieldWrite(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) voidnewSideEffect(AbstractOperator<PointsToSetVariable> op, PointerKey[] arg0) voidnewSideEffect(AbstractOperator<PointsToSetVariable> op, PointerKey arg0, PointerKey arg1) voidnewSideEffect(UnaryOperator<PointsToSetVariable> op, PointerKey arg0) voidoptional method used for performance debuggingprotected voida method that will be called every N evaluations.voidrecord that a particular points-to-set is represented implicitly.protected voidvoidvoidsetPeriodicMaintainInterval(int periodicMaintainInteval) voidsetVerboseInterval(int verboseInterval) voidUnify the points-to-sets for the variables identified by the set sprotected voidMethods inherited from class AbstractFixedPointSolver
addAllStatementsToWorkList, addToWorkList, changedVariable, emptyWorkList, getMaxEvalBetweenTopo, getMinSizeForTopSort, getNumberOfEvaluations, getStatements, getTopologicalGrowthFactor, incNumberOfEvaluations, initForFirstSolve, isChanged, isFixed, isSideEffect, lineBreak, newStatement, newStatement, newStatement, newStatement, newStatement, orderStatements, removeStatement, setMaxEvalBetweenTopo, setMinEquationsForTopSort, setTopologicalGrowthFactor, solve, toStringModifier and TypeMethodDescriptionvoidAdd all to the work list.voidAdd a step to the work list.voidCall this method when the contents of a variable changes.booleanintintintIterator<? extends INodeWithNumber> doublevoidvoidSome setup which occurs only before the first solvestatic booleanisChanged(byte code) static booleanisFixed(byte code) static booleanisSideEffect(byte code) static StringbooleannewStatement(PointsToSetVariable lhs, NullaryOperator<PointsToSetVariable> operator, boolean toWorkList, boolean eager) Add a step with zero operands on the right-hand side.booleannewStatement(PointsToSetVariable lhs, AbstractOperator<PointsToSetVariable> operator, PointsToSetVariable[] rhs, boolean toWorkList, boolean eager) Add a step to the system with an arbitrary number of operands on the right-hand side.booleannewStatement(PointsToSetVariable lhs, AbstractOperator<PointsToSetVariable> operator, PointsToSetVariable op1, PointsToSetVariable op2, boolean toWorkList, boolean eager) Add an equation with two operands on the right-hand side.booleannewStatement(PointsToSetVariable lhs, AbstractOperator<PointsToSetVariable> operator, PointsToSetVariable op1, PointsToSetVariable op2, PointsToSetVariable op3, boolean toWorkList, boolean eager) Add a step with three operands on the right-hand side.booleannewStatement(PointsToSetVariable lhs, UnaryOperator<PointsToSetVariable> operator, PointsToSetVariable rhs, boolean toWorkList, boolean eager) Add a step with one operand on the right-hand side.voidvoidvoidsetMaxEvalBetweenTopo(int i) voidsetMinEquationsForTopSort(int i) voidsetTopologicalGrowthFactor(double d) booleansolve(MonitorUtil.IProgressMonitor monitor) Solve the set of dataflow graph.toString()
-
Field Details
-
pointsToMap
object that tracks points-to sets -
instanceKeys
bijection from InstanceKey <=> Integer -
cg
Governing call graph;
-
-
Constructor Details
-
PropagationSystem
public PropagationSystem(CallGraph cg, PointerKeyFactory pointerKeyFactory, InstanceKeyFactory instanceKeyFactory)
-
-
Method Details
-
makePointerAnalysis
- Returns:
- an object which encapsulates the pointer analysis result
-
registerFixedSet
-
updateSideEffects
-
getInstanceKeysForClass
- Returns:
- a set of integers representing the instance keys that correspond to a given class, or null if there are none.
- Throws:
IllegalArgumentException- if klass is null
-
getInstanceKey
- Returns:
- the instance key numbered with index i
-
getInstanceIndex
-
initializeVariables
protected void initializeVariables()Description copied from class:AbstractFixedPointSolverInitialize all lattice vars in the system.- Specified by:
initializeVariablesin classAbstractFixedPointSolver<PointsToSetVariable>
-
recordImplicitPointsToSet
record that a particular points-to-set is represented implicitly. -
findOrCreatePointsToSet
If key is unified, returns the representative- Returns:
- the dataflow variable that tracks the points-to set for key
-
findOrCreateIndexForInstanceKey
-
newConstraint
NB: this is idempotent ... if the given constraint exists, it will not be added to the system; however, this will be more expensive since it must check if the constraint pre-exits.- Returns:
- true iff the system changes
-
newConstraint
public boolean newConstraint(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs) -
newConstraint
public boolean newConstraint(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs1, PointerKey rhs2) -
newFieldWrite
- Returns:
- true iff the system changes
-
newFieldRead
- Returns:
- true iff the system changes
-
newConstraint
- Returns:
- true iff the system changes
-
newSideEffect
-
newSideEffect
-
newSideEffect
public void newSideEffect(AbstractOperator<PointsToSetVariable> op, PointerKey arg0, PointerKey arg1) -
initializeWorkList
protected void initializeWorkList()Description copied from class:AbstractFixedPointSolverInitialize the work list for iteration.j- Specified by:
initializeWorkListin classAbstractFixedPointSolver<PointsToSetVariable>
-
extractPointerAnalysis
- Returns:
- an object that encapsulates the pointer analysis results
-
performVerboseAction
public void performVerboseAction()Description copied from interface:VerboseActionoptional method used for performance debugging- Specified by:
performVerboseActionin interfaceVerboseAction- Overrides:
performVerboseActionin classAbstractFixedPointSolver<PointsToSetVariable>
-
getFixedPointSystem
- Specified by:
getFixedPointSystemin interfaceIFixedPointSolver<PointsToSetVariable>- Overrides:
getFixedPointSystemin classDefaultFixedPointSolver<PointsToSetVariable>- Returns:
- the set of statements solved by this
IFixedPointSolver
-
iteratePointerKeys
- See Also:
-
getNumberOfPointerKeys
public int getNumberOfPointerKeys()warning: this is _real_ slow; don't use it anywhere performance critical -
getStatementsThatUse
-
getStatementsThatDef
public Iterator<AbstractStatement<PointsToSetVariable, ?>> getStatementsThatDef(PointsToSetVariable v) -
getAssignmentGraph
-
getFilterAsssignmentGraph
-
getFlowGraphIncludingImplicitConstraints
NOTE: do not use this method unless you really know what you are doing. Functionality is fragile and may not work in the future. -
revertToPreTransitive
public void revertToPreTransitive() -
getTransitiveRoots
-
isTransitiveRoot
-
periodicMaintenance
protected void periodicMaintenance()Description copied from class:AbstractFixedPointSolvera method that will be called every N evaluations. subclasses should override as desired.- Overrides:
periodicMaintenancein classAbstractFixedPointSolver<PointsToSetVariable>
-
getVerboseInterval
public int getVerboseInterval()Description copied from class:AbstractFixedPointSolversubclasses should override as desired.- Overrides:
getVerboseIntervalin classAbstractFixedPointSolver<PointsToSetVariable>
-
setVerboseInterval
public void setVerboseInterval(int verboseInterval) - Parameters:
verboseInterval- The verboseInterval to set.
-
getPeriodicMaintainInterval
public int getPeriodicMaintainInterval()Description copied from class:AbstractFixedPointSolversubclasses should override as desired.- Overrides:
getPeriodicMaintainIntervalin classAbstractFixedPointSolver<PointsToSetVariable>
-
setPeriodicMaintainInterval
public void setPeriodicMaintainInterval(int periodicMaintainInteval) -
unify
Unify the points-to-sets for the variables identified by the set s- Parameters:
s- numbers of points-to-set variables- Throws:
IllegalArgumentException- if s is null
-
isUnified
-
isImplicit
-
getNumber
-
makeStmtRHS
- Specified by:
makeStmtRHSin classAbstractFixedPointSolver<PointsToSetVariable>
-