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, workListFields inherited from interface FixedPointConstants
CHANGED, CHANGED_AND_FIXED, CHANGED_MASK, FIXED_MASK, NOT_CHANGED, NOT_CHANGED_AND_FIXED, SIDE_EFFECT_MASK -
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, 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>
-