Package com.android.dx.cf.code
Class Merger
java.lang.Object
com.android.dx.cf.code.Merger
Utility methods to merge various frame information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPossiblyAssignableFrom
(TypeBearer supertypeBearer, TypeBearer subtypeBearer) Returns whether the given supertype is possibly assignable from the given subtype.static OneLocalsArray
mergeLocals
(OneLocalsArray locals1, OneLocalsArray locals2) Merges two locals arrays.static ExecutionStack
mergeStack
(ExecutionStack stack1, ExecutionStack stack2) Merges two stacks.static TypeBearer
mergeType
(TypeBearer ft1, TypeBearer ft2) Merges two frame types.
-
Method Details
-
mergeLocals
Merges two locals arrays. If the merged result is the same as the first argument, then return the first argument (not a copy).- Parameters:
locals1
-non-null;
a locals arraylocals2
-non-null;
another locals array- Returns:
non-null;
the result of merging the two locals arrays
-
mergeStack
Merges two stacks. If the merged result is the same as the first argument, then return the first argument (not a copy).- Parameters:
stack1
-non-null;
a stackstack2
-non-null;
another stack- Returns:
non-null;
the result of merging the two stacks
-
mergeType
Merges two frame types.- Parameters:
ft1
-non-null;
a frame typeft2
-non-null;
another frame type- Returns:
non-null;
the result of merging the two types
-
isPossiblyAssignableFrom
public static boolean isPossiblyAssignableFrom(TypeBearer supertypeBearer, TypeBearer subtypeBearer) Returns whether the given supertype is possibly assignable from the given subtype. This takes into account primitiveness, int-likeness, known-nullness, and array dimensions, but does not assume anything about class hierarchy other than that the typeObject
is the supertype of all reference types and all arrays are assignable toSerializable
andCloneable
.- Parameters:
supertypeBearer
-non-null;
the supertypesubtypeBearer
-non-null;
the subtype
-