Class TypeInferenceVisitor
java.lang.Object
jadx.core.dex.visitors.AbstractVisitor
jadx.core.dex.visitors.typeinference.TypeInferenceVisitor
- All Implemented Interfaces:
IDexTreeVisitor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate RootNodeprivate TypeUpdate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddAssignBound(TypeInfo typeInfo, RegisterArg assign) private voidaddBound(TypeInfo typeInfo, ITypeBound bound) private voidprivate voidattachBounds(SSAVar var) private voidcalculateFromBounds(MethodNode mth, SSAVar ssaVar) getName()Visitor short idprivate static @Nullable ArgTypegetSsaImmutableType(SSAVar ssaVar) voidCalled after loading dex tree, but before visitor traversal.(package private) voidinitTypeBounds(MethodNode mth) Collect initial type bounds from assign and usagesprivate ITypeBoundprivate ITypeBoundmakeAssignInvokeBound(InvokeNode invokeNode) private ITypeBoundmakeInvokeUseBound(RegisterArg regArg, BaseInvokeNode invoke) private @Nullable ITypeBoundmakeUseBound(RegisterArg regArg) private voidmergePhiBounds(SSAVar ssaVar) private ArgType(package private) booleanGuess type from usage and try to set it to current variable and all connected instructions withTypeUpdate.apply(MethodNode, SSAVar, ArgType)selectBestTypeFromBounds(Set<ITypeBound> bounds) private voidsetBestType(MethodNode mth, SSAVar ssaVar) private voidsetImmutableType(MethodNode mth, SSAVar ssaVar) voidvisit(MethodNode mth) Visit methodMethods inherited from class jadx.core.dex.visitors.AbstractVisitor
toString, visit
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
root
-
typeUpdate
-
-
Constructor Details
-
TypeInferenceVisitor
public TypeInferenceVisitor()
-
-
Method Details
-
init
Description copied from interface:IDexTreeVisitorCalled after loading dex tree, but before visitor traversal.- Specified by:
initin interfaceIDexTreeVisitor- Overrides:
initin classAbstractVisitor
-
visit
Description copied from interface:IDexTreeVisitorVisit method- Specified by:
visitin interfaceIDexTreeVisitor- Overrides:
visitin classAbstractVisitor
-
initTypeBounds
Collect initial type bounds from assign and usages -
runTypePropagation
Guess type from usage and try to set it to current variable and all connected instructions withTypeUpdate.apply(MethodNode, SSAVar, ArgType) -
setImmutableType
-
setBestType
-
calculateFromBounds
-
selectBestTypeFromBounds
-
attachBounds
-
mergePhiBounds
-
addBound
-
addAssignBound
-
replaceAnonymousType
-
makeAssignFieldGetBound
-
makeAssignInvokeBound
-
makeUseBound
-
makeInvokeUseBound
-
assignImmutableTypes
-
getSsaImmutableType
-
getName
Description copied from interface:IDexTreeVisitorVisitor short id- Specified by:
getNamein interfaceIDexTreeVisitor- Overrides:
getNamein classAbstractVisitor
-