Package com.strobel.decompiler.ast
Class TypeAnalysis
java.lang.Object
com.strobel.decompiler.ast.TypeAnalysis
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<TypeAnalysis.ExpressionToInfer> private final Map
<Variable, List<TypeAnalysis.ExpressionToInfer>> private DecompilerContext
private boolean
private CoreMetadataFactory
private final IdentityHashMap
<Variable, TypeReference> private boolean
private boolean
private final Map
<Variable, Set<TypeReference>> private final Stack
<Expression> private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static TypeReference
adjustType
(TypeReference type, int flags) private boolean
allDone
(List<TypeAnalysis.ExpressionToInfer> expressions) private boolean
anyDone
(List<TypeAnalysis.ExpressionToInfer> expressions) private TypeReference
cleanTypeArguments
(TypeReference newType, TypeReference alternateType) private void
createDependencyGraph
(Node node) private TypeReference
private TypeReference
doInferTypeForExpression
(Expression expression, TypeReference expectedType, boolean forceInferChildren, int flags) private static TypeReference
ensureReferenceType
(TypeReference mappedType) private void
findNestedAssignments
(Expression expression, TypeAnalysis.ExpressionToInfer parent) (package private) static TypeReference
getFieldType
(FieldReference field) private static int
private void
private TypeReference
inferBinaryArguments
(Expression left, Expression right, TypeReference expectedType, boolean forceInferChildren, TypeReference leftPreferred, TypeReference rightPreferred, int operandFlags) private TypeReference
inferBinaryExpression
(AstCode code, List<Expression> arguments, int flags) private TypeReference
inferCall
(Expression expression, TypeReference expectedType, boolean forceInferChildren) private TypeReference
inferDynamicCall
(Expression expression, TypeReference expectedType, boolean forceInferChildren) private TypeReference
inferInitObject
(Expression expression, TypeReference expectedType, boolean forceInferChildren, MethodReference operand, List<Expression> arguments) private TypeReference
inferTypeForExpression
(Expression expression, TypeReference expectedType) private TypeReference
inferTypeForExpression
(Expression expression, TypeReference expectedType, boolean forceInferChildren) private TypeReference
inferTypeForExpression
(Expression expression, TypeReference expectedType, boolean forceInferChildren, int flags) private TypeReference
inferTypeForExpression
(Expression expression, TypeReference expectedType, int flags) private TypeReference
inferTypeForVariable
(Variable v, TypeReference expectedType) private TypeReference
inferTypeForVariable
(Variable v, TypeReference expectedType, boolean favorExpectedOverActual, int flags) private TypeReference
inferTypeForVariable
(Variable v, TypeReference expectedType, int flags) private void
inferTypesForVariables
(boolean assignVariableTypesBasedOnPartialInformation) private void
invalidateDependentExpressions
(Expression expression, Variable variable) static boolean
isBoolean
(TypeReference type) private boolean
isSameType
(TypeReference t1, TypeReference t2) private boolean
isSingleStoreBoolean
(Variable variable) private boolean
isThisParameter
(Variable variable) static void
reset
(DecompilerContext context, Block method) static void
run
(DecompilerContext context, Block method) private void
private void
runInference
(Expression expression) private void
runInference
(Expression expression, int flags) private boolean
shouldInferVariableType
(Variable variable) private static boolean
shouldResetVariableType
(Variable variable, boolean preserveTypesFromMetadata, boolean preserveGenericTypesFromMetadata) (package private) static TypeReference
substituteTypeArguments
(TypeReference type, MemberReference member) static <T> boolean
trueForAll
(Iterable<T> sequence, Predicate<T> condition) private TypeReference
typeWithMoreInformation
(TypeReference leftPreferred, TypeReference rightPreferred) private void
-
Field Details
-
FLAG_BOOLEAN_PROHIBITED
private static final int FLAG_BOOLEAN_PROHIBITED- See Also:
-
_allExpressions
-
_singleStoreVariables
-
_singleLoadVariables
-
_allVariables
-
_assignmentExpressions
-
_previouslyInferred
-
_inferredVariableTypes
-
_stack
-
_context
-
_factory
-
_preserveMetadataTypes
private boolean _preserveMetadataTypes -
_preserveMetadataGenericTypes
private boolean _preserveMetadataGenericTypes -
_doneInitializing
private boolean _doneInitializing
-
-
Constructor Details
-
TypeAnalysis
public TypeAnalysis()
-
-
Method Details
-
run
-
reset
-
createDependencyGraph
-
findNestedAssignments
-
isSingleStoreBoolean
-
identifySingleLoadVariables
private void identifySingleLoadVariables() -
runInference
private void runInference() -
verifyResults
private void verifyResults() -
inferTypesForVariables
private void inferTypesForVariables(boolean assignVariableTypesBasedOnPartialInformation) -
isThisParameter
-
shouldInferVariableType
-
shouldResetVariableType
private static boolean shouldResetVariableType(Variable variable, boolean preserveTypesFromMetadata, boolean preserveGenericTypesFromMetadata) -
runInference
-
runInference
-
invalidateDependentExpressions
-
inferTypeForExpression
-
inferTypeForExpression
private TypeReference inferTypeForExpression(Expression expression, TypeReference expectedType, int flags) -
inferTypeForExpression
private TypeReference inferTypeForExpression(Expression expression, TypeReference expectedType, boolean forceInferChildren) -
inferTypeForExpression
private TypeReference inferTypeForExpression(Expression expression, TypeReference expectedType, boolean forceInferChildren, int flags) -
doInferTypeForExpression
private TypeReference doInferTypeForExpression(Expression expression, TypeReference expectedType, boolean forceInferChildren, int flags) -
inferInitObject
private TypeReference inferInitObject(Expression expression, TypeReference expectedType, boolean forceInferChildren, MethodReference operand, List<Expression> arguments) -
cleanTypeArguments
-
inferBinaryExpression
-
inferDynamicCall
private TypeReference inferDynamicCall(Expression expression, TypeReference expectedType, boolean forceInferChildren) -
inferCall
private TypeReference inferCall(Expression expression, TypeReference expectedType, boolean forceInferChildren) -
inferTypeForVariable
-
inferTypeForVariable
-
inferTypeForVariable
private TypeReference inferTypeForVariable(Variable v, TypeReference expectedType, boolean favorExpectedOverActual, int flags) -
adjustType
-
doBinaryNumericPromotion
-
inferBinaryArguments
private TypeReference inferBinaryArguments(Expression left, Expression right, TypeReference expectedType, boolean forceInferChildren, TypeReference leftPreferred, TypeReference rightPreferred, int operandFlags) -
typeWithMoreInformation
private TypeReference typeWithMoreInformation(TypeReference leftPreferred, TypeReference rightPreferred) -
getInformationAmount
-
getFieldType
-
substituteTypeArguments
-
isSameType
-
anyDone
-
allDone
-
trueForAll
-
isBoolean
-
ensureReferenceType
-