Class TypeInference
java.lang.Object
com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver<TypeVariable>
com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver<TypeVariable>
com.ibm.wala.dataflow.ssa.SSAInference<TypeVariable>
com.ibm.wala.analysis.typeInference.TypeInference
- All Implemented Interfaces:
FixedPointConstants, IFixedPointSolver<TypeVariable>, VerboseAction
- Direct Known Subclasses:
AstTypeInference, DalvikTypeInference
This class performs intraprocedural type propagation on an SSA IR.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classAn operator which initializes a type to a declared type.protected static classprotected classclassNested classes/interfaces inherited from class SSAInference
SSAInference.OperatorFactory<T>, SSAInference.VariableFactory<T>Nested classes/interfaces inherited from class AbstractFixedPointSolver
AbstractFixedPointSolver.Statement -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TypeAbstractionA cone type for java.lang.Objectprotected final IClassHierarchyThe governing class hierarchyprotected final booleanshould type inference track primitive types?protected final IRThe governing SSA formprotected final LanguageFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtract all results of the type inference analysis.getConstantPrimitiveType(int valueNumber) getConstantType(int valueNumber) getIR()getType(int valueNumber) Return the type computed for a particular value numberprotected voidprotected voidInitialize all lattice vars in the system.protected voidInitialize the work list for iteration.jbooleanisUndefined(int valueNumber) static TypeInferenceprotected TypeVariable[]makeStmtRHS(int size) booleansolve()booleansolve(MonitorUtil.IProgressMonitor monitor) Solve the set of dataflow graph.Methods inherited from class SSAInference
getVariable, init, toStringMethods inherited from class DefaultFixedPointSolver
getFixedPointSystemMethods inherited from class AbstractFixedPointSolver
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
-
Field Details
-
ir
The governing SSA form -
cha
The governing class hierarchy -
language
-
BOTTOM
A cone type for java.lang.Object -
doPrimitives
protected final boolean doPrimitivesshould type inference track primitive types?
-
-
Constructor Details
-
TypeInference
-
-
Method Details
-
make
-
solve
public boolean solve() -
solve
Description copied from class:AbstractFixedPointSolverSolve the set of dataflow graph.PRECONDITION: graph is set up
- Specified by:
solvein interfaceIFixedPointSolver<TypeVariable>- Overrides:
solvein classAbstractFixedPointSolver<TypeVariable>- Returns:
- true iff the evaluation of some equation caused a change in the value of some variable.
-
initialize
protected void initialize() -
initializeVariables
protected void initializeVariables()Description copied from class:AbstractFixedPointSolverInitialize all lattice vars in the system.- Specified by:
initializeVariablesin classAbstractFixedPointSolver<TypeVariable>
-
initializeWorkList
protected void initializeWorkList()Description copied from class:AbstractFixedPointSolverInitialize the work list for iteration.j- Specified by:
initializeWorkListin classAbstractFixedPointSolver<TypeVariable>
-
getIR
-
getType
Return the type computed for a particular value number -
getConstantType
-
getConstantPrimitiveType
-
isUndefined
public boolean isUndefined(int valueNumber) -
extractAllResults
Extract all results of the type inference analysis.- Returns:
- an array, where the i'th variable holds the type abstraction of the i'th value number.
-
makeStmtRHS
- Specified by:
makeStmtRHSin classAbstractFixedPointSolver<TypeVariable>
-