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 com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
AbstractFixedPointSolver.Statement
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CallGraph
Governing call graph;protected final MutableMapping
<InstanceKey> bijection from InstanceKey <=> Integerprotected final PointsToMap
object that tracks points-to setsFields inherited from class com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
DEFAULT_PERIODIC_MAINTENANCE_INTERVAL, DEFAULT_VERBOSE_INTERVAL, verbose, workList
Fields inherited from interface com.ibm.wala.fixpoint.FixedPointConstants
CHANGED, CHANGED_AND_FIXED, CHANGED_MASK, FIXED_MASK, NOT_CHANGED, NOT_CHANGED_AND_FIXED, SIDE_EFFECT_MASK
-
Constructor Summary
ConstructorDescriptionPropagationSystem
(CallGraph cg, PointerKeyFactory pointerKeyFactory, InstanceKeyFactory instanceKeyFactory) -
Method Summary
Modifier and TypeMethodDescriptionint
If key is unified, returns the representativeNOTE: do not use this method unless you really know what you are doing.int
getInstanceKey
(int i) getInstanceKeysForClass
(IClass klass) int
int
warning: this is _real_ slow; don't use it anywhere performance criticalint
subclasses should override as desired.int
subclasses should override as desired.protected void
Initialize all lattice vars in the system.protected void
Initialize the work list for iteration.jboolean
isImplicit
(PointerKey result) boolean
boolean
isUnified
(PointerKey result) protected PointsToSetVariable[]
makeStmtRHS
(int size) boolean
newConstraint
(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs) boolean
newConstraint
(PointerKey lhs, AbstractOperator<PointsToSetVariable> op, PointerKey rhs1, PointerKey rhs2) boolean
newConstraint
(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) NB: this is idempotent ...boolean
newConstraint
(PointerKey lhs, InstanceKey value) boolean
newFieldRead
(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) boolean
newFieldWrite
(PointerKey lhs, UnaryOperator<PointsToSetVariable> op, PointerKey rhs) void
newSideEffect
(AbstractOperator<PointsToSetVariable> op, PointerKey[] arg0) void
newSideEffect
(AbstractOperator<PointsToSetVariable> op, PointerKey arg0, PointerKey arg1) void
newSideEffect
(UnaryOperator<PointsToSetVariable> op, PointerKey arg0) void
optional method used for performance debuggingprotected void
a method that will be called every N evaluations.void
record that a particular points-to-set is represented implicitly.protected void
void
void
setPeriodicMaintainInterval
(int periodicMaintainInteval) void
setVerboseInterval
(int verboseInterval) void
Unify the points-to-sets for the variables identified by the set sprotected void
Methods inherited from class com.ibm.wala.fixedpoint.impl.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:AbstractFixedPointSolver
Initialize all lattice vars in the system.- Specified by:
initializeVariables
in 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:AbstractFixedPointSolver
Initialize the work list for iteration.j- Specified by:
initializeWorkList
in classAbstractFixedPointSolver<PointsToSetVariable>
-
extractPointerAnalysis
- Returns:
- an object that encapsulates the pointer analysis results
-
performVerboseAction
public void performVerboseAction()Description copied from interface:VerboseAction
optional method used for performance debugging- Specified by:
performVerboseAction
in interfaceVerboseAction
- Overrides:
performVerboseAction
in classAbstractFixedPointSolver<PointsToSetVariable>
-
getFixedPointSystem
- Specified by:
getFixedPointSystem
in interfaceIFixedPointSolver<PointsToSetVariable>
- Overrides:
getFixedPointSystem
in 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:AbstractFixedPointSolver
a method that will be called every N evaluations. subclasses should override as desired.- Overrides:
periodicMaintenance
in classAbstractFixedPointSolver<PointsToSetVariable>
-
getVerboseInterval
public int getVerboseInterval()Description copied from class:AbstractFixedPointSolver
subclasses should override as desired.- Overrides:
getVerboseInterval
in classAbstractFixedPointSolver<PointsToSetVariable>
-
setVerboseInterval
public void setVerboseInterval(int verboseInterval) - Parameters:
verboseInterval
- The verboseInterval to set.
-
getPeriodicMaintainInterval
public int getPeriodicMaintainInterval()Description copied from class:AbstractFixedPointSolver
subclasses should override as desired.- Overrides:
getPeriodicMaintainInterval
in 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:
makeStmtRHS
in classAbstractFixedPointSolver<PointsToSetVariable>
-