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
Modifier and TypeClassDescriptionprotected static final class
An operator which initializes a type to a declared type.protected static class
protected class
class
Nested classes/interfaces inherited from class com.ibm.wala.dataflow.ssa.SSAInference
SSAInference.OperatorFactory<T extends IVariable<T>>, SSAInference.VariableFactory<T extends IVariable<T>>
Nested classes/interfaces inherited from class com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
AbstractFixedPointSolver.Statement
-
Field Summary
Modifier and TypeFieldDescriptionprotected final TypeAbstraction
A cone type for java.lang.Objectprotected final IClassHierarchy
The governing class hierarchyprotected final boolean
should type inference track primitive types?protected final IR
The governing SSA formprotected final Language
Fields 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
-
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 void
protected void
Initialize all lattice vars in the system.protected void
Initialize the work list for iteration.jboolean
isUndefined
(int valueNumber) static TypeInference
protected TypeVariable[]
makeStmtRHS
(int size) boolean
solve()
boolean
solve
(MonitorUtil.IProgressMonitor monitor) Solve the set of dataflow graph.Methods inherited from class com.ibm.wala.dataflow.ssa.SSAInference
getVariable, init, toString
Methods inherited from class com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver
getFixedPointSystem
Methods inherited from class com.ibm.wala.fixedpoint.impl.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:AbstractFixedPointSolver
Solve the set of dataflow graph.PRECONDITION: graph is set up
- Specified by:
solve
in interfaceIFixedPointSolver<TypeVariable>
- Overrides:
solve
in 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:AbstractFixedPointSolver
Initialize all lattice vars in the system.- Specified by:
initializeVariables
in classAbstractFixedPointSolver<TypeVariable>
-
initializeWorkList
protected void initializeWorkList()Description copied from class:AbstractFixedPointSolver
Initialize the work list for iteration.j- Specified by:
initializeWorkList
in 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:
makeStmtRHS
in classAbstractFixedPointSolver<TypeVariable>
-