public class TypeInference extends SSAInference<TypeVariable> implements FixedPointConstants
Modifier and Type | Class and Description |
---|---|
protected static class |
TypeInference.DeclaredTypeOperator
An operator which initializes a type to a declared type.
|
protected static class |
TypeInference.PrimitivePropagateOperator |
protected class |
TypeInference.TypeOperatorFactory |
class |
TypeInference.TypeVarFactory |
SSAInference.OperatorFactory<T extends IVariable>, SSAInference.VariableFactory
AbstractFixedPointSolver.Statement
Modifier and Type | Field and Description |
---|---|
protected TypeAbstraction |
BOTTOM
A cone type for java.lang.Object
|
protected IClassHierarchy |
cha
The governing class hierarchy
|
protected boolean |
doPrimitives
should type inference track primitive types?
|
protected IR |
ir
The governing SSA form
|
protected Language |
language |
DEFAULT_PERIODIC_MAINTENANCE_INTERVAL, DEFAULT_VERBOSE_INTERVAL, verbose, workList
CHANGED, CHANGED_AND_FIXED, CHANGED_MASK, FIXED_MASK, NOT_CHANGED, NOT_CHANGED_AND_FIXED, SIDE_EFFECT_MASK
Modifier | Constructor and Description |
---|---|
protected |
TypeInference(IR ir,
boolean doPrimitives) |
Modifier and Type | Method and Description |
---|---|
TypeAbstraction[] |
extractAllResults()
Extract all results of the type inference analysis.
|
TypeAbstraction |
getConstantPrimitiveType(int valueNumber) |
TypeAbstraction |
getConstantType(int valueNumber) |
IR |
getIR() |
TypeAbstraction |
getType(int valueNumber)
Return the type computed for a particular value number
|
protected void |
initialize() |
protected void |
initializeVariables()
Initialize all lattice vars in the system.
|
protected void |
initializeWorkList()
Initialize the work list for iteration.j
|
boolean |
isUndefined(int valueNumber) |
static TypeInference |
make(IR ir,
boolean doPrimitives) |
protected TypeVariable[] |
makeStmtRHS(int size) |
boolean |
solve() |
boolean |
solve(MonitorUtil.IProgressMonitor monitor)
Solve the set of dataflow graph.
|
getVariable, init, toString
getFixedPointSystem
addAllStatementsToWorkList, addToWorkList, changedVariable, emptyWorkList, getMaxEvalBetweenTopo, getMinSizeForTopSort, getNumberOfEvaluations, getPeriodicMaintainInterval, getStatements, getTopologicalGrowthFactor, getVerboseInterval, incNumberOfEvaluations, initForFirstSolve, isChanged, isFixed, isSideEffect, lineBreak, newStatement, newStatement, newStatement, newStatement, newStatement, orderStatements, performVerboseAction, periodicMaintenance, removeStatement, setMaxEvalBetweenTopo, setMinEquationsForTopSort, setTopologicalGrowthFactor
protected final IR ir
protected final IClassHierarchy cha
protected final Language language
protected final TypeAbstraction BOTTOM
protected final boolean doPrimitives
protected TypeInference(IR ir, boolean doPrimitives)
public static TypeInference make(IR ir, boolean doPrimitives)
public boolean solve()
public boolean solve(MonitorUtil.IProgressMonitor monitor)
AbstractFixedPointSolver
PRECONDITION: graph is set up
solve
in interface IFixedPointSolver<TypeVariable>
solve
in class AbstractFixedPointSolver<TypeVariable>
protected void initialize()
protected void initializeVariables()
AbstractFixedPointSolver
initializeVariables
in class AbstractFixedPointSolver<TypeVariable>
protected void initializeWorkList()
AbstractFixedPointSolver
initializeWorkList
in class AbstractFixedPointSolver<TypeVariable>
public IR getIR()
public TypeAbstraction getType(int valueNumber)
public TypeAbstraction getConstantType(int valueNumber)
public TypeAbstraction getConstantPrimitiveType(int valueNumber)
public boolean isUndefined(int valueNumber)
public TypeAbstraction[] extractAllResults()
protected TypeVariable[] makeStmtRHS(int size)
makeStmtRHS
in class AbstractFixedPointSolver<TypeVariable>