|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
public abstract class AbstractFixedPointSolver
Represents a set of IFixedPointStatements to be solved by a
IFixedPointSolver
Implementation Note: The set of steps and variables is internally represented as a graph. Each step and each variable is a node in the graph. If a step produces a variable that is used by another step, the graph has a directed edge from the producer to the consumer. Fixed-point iteration proceeds in a topological order according to these edges.
| Field Summary | |
|---|---|
static int |
DEFAULT_PERIODIC_MAINTENANCE_INTERVAL
|
static int |
DEFAULT_VERBOSE_INTERVAL
|
static boolean |
verbose
|
protected Worklist |
workList
worklist for the iterative solver |
| 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 | |
|---|---|
AbstractFixedPointSolver()
|
|
| Method Summary | |
|---|---|
void |
addAllStatementsToWorkList()
Add all to the work list. |
void |
addToWorkList(AbstractStatement s)
Add a step to the work list. |
void |
changedVariable(IVariable v)
Call this method when the contents of a variable changes. |
boolean |
emptyWorkList()
|
int |
getMaxEvalBetweenTopo()
|
int |
getMinSizeForTopSort()
|
int |
getNumberOfEvaluations()
|
protected int |
getPeriodicMaintainInterval()
subclasses should override as desired. |
java.util.Iterator |
getStatements()
|
double |
getTopologicalGrowthFactor()
|
protected int |
getVerboseInterval()
subclasses should override as desired. |
void |
incNumberOfEvaluations()
|
void |
initForFirstSolve()
Some setup which occurs only before the first solve |
protected abstract void |
initializeVariables()
Initialize all lattice vars in the system. |
protected abstract void |
initializeWorkList()
Initialize the work list for iteration.j |
static boolean |
isChanged(byte code)
|
static boolean |
isFixed(byte code)
|
static boolean |
isSideEffect(byte code)
|
static java.lang.String |
lineBreak(java.lang.String string,
int wrap)
|
void |
newStatement(IVariable lhs,
AbstractOperator operator,
IVariable[] rhs,
boolean toWorkList,
boolean eager)
Add a step to the system with an arbitrary number of operands on the right-hand side. |
void |
newStatement(IVariable lhs,
AbstractOperator operator,
IVariable op1,
IVariable op2,
boolean toWorkList,
boolean eager)
Add an equation with two operands on the right-hand side. |
void |
newStatement(IVariable lhs,
AbstractOperator operator,
IVariable op1,
IVariable op2,
IVariable op3,
boolean toWorkList,
boolean eager)
Add a step with three operands on the right-hand side. |
void |
newStatement(IVariable lhs,
NullaryOperator operator,
boolean toWorkList,
boolean eager)
Add a step with zero operands on the right-hand side. |
boolean |
newStatement(IVariable lhs,
UnaryOperator operator,
IVariable rhs,
boolean toWorkList,
boolean eager)
Add a step with one operand on the right-hand side. |
void |
orderStatements()
|
void |
performVerboseAction()
optional method used for performance debugging |
protected void |
periodicMaintenance()
a method that will be called every N evaluations. |
void |
removeStatement(AbstractStatement s)
|
void |
setMaxEvalBetweenTopo(int i)
|
void |
setMinEquationsForTopSort(int i)
|
void |
setTopologicalGrowthFactor(double d)
|
boolean |
solve()
Solve the set of dataflow graph. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ibm.wala.fixpoint.IFixedPointSolver |
|---|
getFixedPointSystem |
| Field Detail |
|---|
public static final boolean verbose
public static final int DEFAULT_VERBOSE_INTERVAL
public static final int DEFAULT_PERIODIC_MAINTENANCE_INTERVAL
protected Worklist workList
| Constructor Detail |
|---|
public AbstractFixedPointSolver()
| Method Detail |
|---|
public void initForFirstSolve()
public boolean emptyWorkList()
public boolean solve()
PRECONDITION: graph is set up
solve in interface IFixedPointSolverpublic void performVerboseAction()
VerboseAction
performVerboseAction in interface VerboseAction
public static java.lang.String lineBreak(java.lang.String string,
int wrap)
public void removeStatement(AbstractStatement s)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator getStatements()
public void addToWorkList(AbstractStatement s)
s - the step to addpublic void addAllStatementsToWorkList()
public void changedVariable(IVariable v)
v - the variable that has changed
public void newStatement(IVariable lhs,
NullaryOperator operator,
boolean toWorkList,
boolean eager)
lhs - the variable set by this equationoperator - the step operator
java.lang.IllegalArgumentException - if lhs is null
public boolean newStatement(IVariable lhs,
UnaryOperator operator,
IVariable rhs,
boolean toWorkList,
boolean eager)
lhs - the lattice variable set by this equationoperator - the step's operatorrhs - first operand on the rhs
java.lang.IllegalArgumentException - if operator is null
public void newStatement(IVariable lhs,
AbstractOperator operator,
IVariable op1,
IVariable op2,
boolean toWorkList,
boolean eager)
lhs - the lattice variable set by this equationoperator - the equation operatorop1 - first operand on the rhsop2 - second operand on the rhs
public void newStatement(IVariable lhs,
AbstractOperator operator,
IVariable op1,
IVariable op2,
IVariable op3,
boolean toWorkList,
boolean eager)
lhs - the lattice variable set by this equationoperator - the equation operatorop1 - first operand on the rhsop2 - second operand on the rhsop3 - third operand on the rhs
java.lang.IllegalArgumentException - if lhs is null
public void newStatement(IVariable lhs,
AbstractOperator operator,
IVariable[] rhs,
boolean toWorkList,
boolean eager)
lhs - lattice variable set by this equationoperator - the operatorrhs - the operands on the rhsprotected abstract void initializeVariables()
protected abstract void initializeWorkList()
public void orderStatements()
public static boolean isChanged(byte code)
public static boolean isSideEffect(byte code)
public static boolean isFixed(byte code)
public int getMinSizeForTopSort()
public void setMinEquationsForTopSort(int i)
i - public int getMaxEvalBetweenTopo()
public double getTopologicalGrowthFactor()
public void setMaxEvalBetweenTopo(int i)
i - public void setTopologicalGrowthFactor(double d)
d - public int getNumberOfEvaluations()
public void incNumberOfEvaluations()
protected void periodicMaintenance()
protected int getVerboseInterval()
protected int getPeriodicMaintainInterval()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||