com.android.dx.cf.code
Class Merger

java.lang.Object
  extended by com.android.dx.cf.code.Merger

public final class Merger
extends Object

Utility methods to merge various frame information.


Method Summary
static 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mergeLocals

public static OneLocalsArray mergeLocals(OneLocalsArray locals1,
                                         OneLocalsArray locals2)
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 array
locals2 - non-null; another locals array
Returns:
non-null; the result of merging the two locals arrays

mergeStack

public static ExecutionStack mergeStack(ExecutionStack stack1,
                                        ExecutionStack stack2)
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 stack
stack2 - non-null; another stack
Returns:
non-null; the result of merging the two stacks

mergeType

public static TypeBearer mergeType(TypeBearer ft1,
                                   TypeBearer ft2)
Merges two frame types.

Parameters:
ft1 - non-null; a frame type
ft2 - 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 type Object is the supertype of all reference types and all arrays are assignable to Serializable and Cloneable.

Parameters:
supertypeBearer - non-null; the supertype
subtypeBearer - non-null; the subtype


Copyright © 2015. All rights reserved.