Class SSAInference<T extends IVariable<T>>
java.lang.Object
com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver<T>
com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver<T>
com.ibm.wala.dataflow.ssa.SSAInference<T>
- All Implemented Interfaces:
FixedPointConstants, IFixedPointSolver<T>, VerboseAction
- Direct Known Subclasses:
TypeInference
This class performs intra-procedural propagation over an SSA form.
A client will subclass an SSAInference by providing factories that generate IVariables corresponding to SSA value numbers, and AbstractOperators corresponding to
SSA instructions. This class will set up a dataflow system induced by the SSA def-use graph, and
solve the system by iterating to a fixed point.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSSAInference.OperatorFactory<T extends IVariable<T>>static interfaceSSAInference.VariableFactory<T extends IVariable<T>>Nested classes/interfaces inherited from class AbstractFixedPointSolver
AbstractFixedPointSolver.Statement -
Field Summary
Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TgetVariable(int valueNumber) protected voidinit(IR ir, SSAInference.VariableFactory<T> varFactory, SSAInference.OperatorFactory<T> opFactory) initializer for SSA Inference equations.toString()Return a string representation of the systemMethods inherited from class DefaultFixedPointSolver
getFixedPointSystemMethods inherited from class AbstractFixedPointSolver
addAllStatementsToWorkList, addToWorkList, changedVariable, emptyWorkList, getMaxEvalBetweenTopo, getMinSizeForTopSort, getNumberOfEvaluations, getPeriodicMaintainInterval, getStatements, getTopologicalGrowthFactor, getVerboseInterval, incNumberOfEvaluations, initForFirstSolve, initializeVariables, initializeWorkList, isChanged, isFixed, isSideEffect, lineBreak, makeStmtRHS, newStatement, newStatement, newStatement, newStatement, newStatement, orderStatements, performVerboseAction, periodicMaintenance, removeStatement, setMaxEvalBetweenTopo, setMinEquationsForTopSort, setTopologicalGrowthFactor, solveModifier and TypeMethodDescriptionvoidAdd all to the work list.voidAdd a step to the work list.voidchangedVariable(T v) Call this method when the contents of a variable changes.booleanintintintprotected intsubclasses should override as desired.Iterator<? extends INodeWithNumber> doubleprotected intsubclasses should override as desired.voidvoidSome setup which occurs only before the first solveprotected abstract voidInitialize all lattice vars in the system.protected abstract voidInitialize the work list for iteration.jstatic booleanisChanged(byte code) static booleanisFixed(byte code) static booleanisSideEffect(byte code) static Stringprotected abstract T[]makeStmtRHS(int size) booleannewStatement(T lhs, NullaryOperator<T> operator, boolean toWorkList, boolean eager) Add a step with zero operands on the right-hand side.booleannewStatement(T lhs, AbstractOperator<T> operator, T[] rhs, boolean toWorkList, boolean eager) Add a step to the system with an arbitrary number of operands on the right-hand side.booleannewStatement(T lhs, AbstractOperator<T> operator, T op1, T op2, boolean toWorkList, boolean eager) Add an equation with two operands on the right-hand side.booleannewStatement(T lhs, AbstractOperator<T> operator, T op1, T op2, T op3, boolean toWorkList, boolean eager) Add a step with three operands on the right-hand side.booleannewStatement(T lhs, UnaryOperator<T> operator, T rhs, boolean toWorkList, boolean eager) Add a step with one operand on the right-hand side.voidvoidoptional method used for performance debuggingprotected voida method that will be called every N evaluations.voidvoidsetMaxEvalBetweenTopo(int i) voidsetMinEquationsForTopSort(int i) voidsetTopologicalGrowthFactor(double d) booleansolve(MonitorUtil.IProgressMonitor monitor) Solve the set of dataflow graph.
-
Constructor Details
-
SSAInference
public SSAInference()
-
-
Method Details
-
init
protected void init(IR ir, SSAInference.VariableFactory<T> varFactory, SSAInference.OperatorFactory<T> opFactory) initializer for SSA Inference equations. -
getVariable
- Returns:
- the dataflow variable representing the value number, or null if none found.
-
toString
-