FileDocCategorySizeDatePackage
Rops.javaAPI DocAndroid 5.1 API82635Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.code

Rops

public final class Rops extends Object
Standard instances of {@link Rop}.

Fields Summary
public static final Rop
NOP
{@code nop()}
public static final Rop
MOVE_INT
{@code r,x: int :: r = x;}
public static final Rop
MOVE_LONG
{@code r,x: long :: r = x;}
public static final Rop
MOVE_FLOAT
{@code r,x: float :: r = x;}
public static final Rop
MOVE_DOUBLE
{@code r,x: double :: r = x;}
public static final Rop
MOVE_OBJECT
{@code r,x: Object :: r = x;}
public static final Rop
MOVE_RETURN_ADDRESS
{@code r,x: ReturnAddress :: r = x;} Note that this rop-form instruction has no dex-form equivilent and must be removed before the dex conversion.
public static final Rop
MOVE_PARAM_INT
{@code r,param(x): int :: r = param(x);}
public static final Rop
MOVE_PARAM_LONG
{@code r,param(x): long :: r = param(x);}
public static final Rop
MOVE_PARAM_FLOAT
{@code r,param(x): float :: r = param(x);}
public static final Rop
MOVE_PARAM_DOUBLE
{@code r,param(x): double :: r = param(x);}
public static final Rop
MOVE_PARAM_OBJECT
{@code r,param(x): Object :: r = param(x);}
public static final Rop
CONST_INT
{@code r, literal: int :: r = literal;}
public static final Rop
CONST_LONG
{@code r, literal: long :: r = literal;}
public static final Rop
CONST_FLOAT
{@code r, literal: float :: r = literal;}
public static final Rop
CONST_DOUBLE
{@code r, literal: double :: r = literal;}
public static final Rop
CONST_OBJECT
{@code r, literal: Object :: r = literal;}
public static final Rop
CONST_OBJECT_NOTHROW
{@code r, literal: Object :: r = literal;}
public static final Rop
GOTO
{@code goto label}
public static final Rop
IF_EQZ_INT
{@code x: int :: if (x == 0) goto label}
public static final Rop
IF_NEZ_INT
{@code x: int :: if (x != 0) goto label}
public static final Rop
IF_LTZ_INT
{@code x: int :: if (x < 0) goto label}
public static final Rop
IF_GEZ_INT
{@code x: int :: if (x >= 0) goto label}
public static final Rop
IF_LEZ_INT
{@code x: int :: if (x <= 0) goto label}
public static final Rop
IF_GTZ_INT
{@code x: int :: if (x > 0) goto label}
public static final Rop
IF_EQZ_OBJECT
{@code x: Object :: if (x == null) goto label}
public static final Rop
IF_NEZ_OBJECT
{@code x: Object :: if (x != null) goto label}
public static final Rop
IF_EQ_INT
{@code x,y: int :: if (x == y) goto label}
public static final Rop
IF_NE_INT
{@code x,y: int :: if (x != y) goto label}
public static final Rop
IF_LT_INT
{@code x,y: int :: if (x < y) goto label}
public static final Rop
IF_GE_INT
{@code x,y: int :: if (x >= y) goto label}
public static final Rop
IF_LE_INT
{@code x,y: int :: if (x <= y) goto label}
public static final Rop
IF_GT_INT
{@code x,y: int :: if (x > y) goto label}
public static final Rop
IF_EQ_OBJECT
{@code x,y: Object :: if (x == y) goto label}
public static final Rop
IF_NE_OBJECT
{@code x,y: Object :: if (x != y) goto label}
public static final Rop
SWITCH
{@code x: int :: goto switchtable[x]}
public static final Rop
ADD_INT
{@code r,x,y: int :: r = x + y;}
public static final Rop
ADD_LONG
{@code r,x,y: long :: r = x + y;}
public static final Rop
ADD_FLOAT
{@code r,x,y: float :: r = x + y;}
public static final Rop
ADD_DOUBLE
{@code r,x,y: double :: r = x + y;}
public static final Rop
SUB_INT
{@code r,x,y: int :: r = x - y;}
public static final Rop
SUB_LONG
{@code r,x,y: long :: r = x - y;}
public static final Rop
SUB_FLOAT
{@code r,x,y: float :: r = x - y;}
public static final Rop
SUB_DOUBLE
{@code r,x,y: double :: r = x - y;}
public static final Rop
MUL_INT
{@code r,x,y: int :: r = x * y;}
public static final Rop
MUL_LONG
{@code r,x,y: long :: r = x * y;}
public static final Rop
MUL_FLOAT
{@code r,x,y: float :: r = x * y;}
public static final Rop
MUL_DOUBLE
{@code r,x,y: double :: r = x * y;}
public static final Rop
DIV_INT
{@code r,x,y: int :: r = x / y;}
public static final Rop
DIV_LONG
{@code r,x,y: long :: r = x / y;}
public static final Rop
DIV_FLOAT
{@code r,x,y: float :: r = x / y;}
public static final Rop
DIV_DOUBLE
{@code r,x,y: double :: r = x / y;}
public static final Rop
REM_INT
{@code r,x,y: int :: r = x % y;}
public static final Rop
REM_LONG
{@code r,x,y: long :: r = x % y;}
public static final Rop
REM_FLOAT
{@code r,x,y: float :: r = x % y;}
public static final Rop
REM_DOUBLE
{@code r,x,y: double :: r = x % y;}
public static final Rop
NEG_INT
{@code r,x: int :: r = -x;}
public static final Rop
NEG_LONG
{@code r,x: long :: r = -x;}
public static final Rop
NEG_FLOAT
{@code r,x: float :: r = -x;}
public static final Rop
NEG_DOUBLE
{@code r,x: double :: r = -x;}
public static final Rop
AND_INT
{@code r,x,y: int :: r = x & y;}
public static final Rop
AND_LONG
{@code r,x,y: long :: r = x & y;}
public static final Rop
OR_INT
{@code r,x,y: int :: r = x | y;}
public static final Rop
OR_LONG
{@code r,x,y: long :: r = x | y;}
public static final Rop
XOR_INT
{@code r,x,y: int :: r = x ^ y;}
public static final Rop
XOR_LONG
{@code r,x,y: long :: r = x ^ y;}
public static final Rop
SHL_INT
{@code r,x,y: int :: r = x << y;}
public static final Rop
SHL_LONG
{@code r,x: long; y: int :: r = x << y;}
public static final Rop
SHR_INT
{@code r,x,y: int :: r = x >> y;}
public static final Rop
SHR_LONG
{@code r,x: long; y: int :: r = x >> y;}
public static final Rop
USHR_INT
{@code r,x,y: int :: r = x >>> y;}
public static final Rop
USHR_LONG
{@code r,x: long; y: int :: r = x >>> y;}
public static final Rop
NOT_INT
{@code r,x: int :: r = ~x;}
public static final Rop
NOT_LONG
{@code r,x: long :: r = ~x;}
public static final Rop
ADD_CONST_INT
{@code r,x,c: int :: r = x + c;}
public static final Rop
ADD_CONST_LONG
{@code r,x,c: long :: r = x + c;}
public static final Rop
ADD_CONST_FLOAT
{@code r,x,c: float :: r = x + c;}
public static final Rop
ADD_CONST_DOUBLE
{@code r,x,c: double :: r = x + c;}
public static final Rop
SUB_CONST_INT
{@code r,x,c: int :: r = x - c;}
public static final Rop
SUB_CONST_LONG
{@code r,x,c: long :: r = x - c;}
public static final Rop
SUB_CONST_FLOAT
{@code r,x,c: float :: r = x - c;}
public static final Rop
SUB_CONST_DOUBLE
{@code r,x,c: double :: r = x - c;}
public static final Rop
MUL_CONST_INT
{@code r,x,c: int :: r = x * c;}
public static final Rop
MUL_CONST_LONG
{@code r,x,c: long :: r = x * c;}
public static final Rop
MUL_CONST_FLOAT
{@code r,x,c: float :: r = x * c;}
public static final Rop
MUL_CONST_DOUBLE
{@code r,x,c: double :: r = x * c;}
public static final Rop
DIV_CONST_INT
{@code r,x,c: int :: r = x / c;}
public static final Rop
DIV_CONST_LONG
{@code r,x,c: long :: r = x / c;}
public static final Rop
DIV_CONST_FLOAT
{@code r,x,c: float :: r = x / c;}
public static final Rop
DIV_CONST_DOUBLE
{@code r,x,c: double :: r = x / c;}
public static final Rop
REM_CONST_INT
{@code r,x,c: int :: r = x % c;}
public static final Rop
REM_CONST_LONG
{@code r,x,c: long :: r = x % c;}
public static final Rop
REM_CONST_FLOAT
{@code r,x,c: float :: r = x % c;}
public static final Rop
REM_CONST_DOUBLE
{@code r,x,c: double :: r = x % c;}
public static final Rop
AND_CONST_INT
{@code r,x,c: int :: r = x & c;}
public static final Rop
AND_CONST_LONG
{@code r,x,c: long :: r = x & c;}
public static final Rop
OR_CONST_INT
{@code r,x,c: int :: r = x | c;}
public static final Rop
OR_CONST_LONG
{@code r,x,c: long :: r = x | c;}
public static final Rop
XOR_CONST_INT
{@code r,x,c: int :: r = x ^ c;}
public static final Rop
XOR_CONST_LONG
{@code r,x,c: long :: r = x ^ c;}
public static final Rop
SHL_CONST_INT
{@code r,x,c: int :: r = x << c;}
public static final Rop
SHL_CONST_LONG
{@code r,x: long; c: int :: r = x << c;}
public static final Rop
SHR_CONST_INT
{@code r,x,c: int :: r = x >> c;}
public static final Rop
SHR_CONST_LONG
{@code r,x: long; c: int :: r = x >> c;}
public static final Rop
USHR_CONST_INT
{@code r,x,c: int :: r = x >>> c;}
public static final Rop
USHR_CONST_LONG
{@code r,x: long; c: int :: r = x >>> c;}
public static final Rop
CMPL_LONG
{@code r: int; x,y: long :: r = cmp(x, y);}
public static final Rop
CMPL_FLOAT
{@code r: int; x,y: float :: r = cmpl(x, y);}
public static final Rop
CMPL_DOUBLE
{@code r: int; x,y: double :: r = cmpl(x, y);}
public static final Rop
CMPG_FLOAT
{@code r: int; x,y: float :: r = cmpg(x, y);}
public static final Rop
CMPG_DOUBLE
{@code r: int; x,y: double :: r = cmpg(x, y);}
public static final Rop
CONV_L2I
{@code r: int; x: long :: r = (int) x}
public static final Rop
CONV_F2I
{@code r: int; x: float :: r = (int) x}
public static final Rop
CONV_D2I
{@code r: int; x: double :: r = (int) x}
public static final Rop
CONV_I2L
{@code r: long; x: int :: r = (long) x}
public static final Rop
CONV_F2L
{@code r: long; x: float :: r = (long) x}
public static final Rop
CONV_D2L
{@code r: long; x: double :: r = (long) x}
public static final Rop
CONV_I2F
{@code r: float; x: int :: r = (float) x}
public static final Rop
CONV_L2F
{@code r: float; x: long :: r = (float) x}
public static final Rop
CONV_D2F
{@code r: float; x: double :: r = (float) x}
public static final Rop
CONV_I2D
{@code r: double; x: int :: r = (double) x}
public static final Rop
CONV_L2D
{@code r: double; x: long :: r = (double) x}
public static final Rop
CONV_F2D
{@code r: double; x: float :: r = (double) x}
public static final Rop
TO_BYTE
{@code r,x: int :: r = (x << 24) >> 24} (Java-style convert int to byte)
public static final Rop
TO_CHAR
{@code r,x: int :: r = x & 0xffff} (Java-style convert int to char)
public static final Rop
TO_SHORT
{@code r,x: int :: r = (x << 16) >> 16} (Java-style convert int to short)
public static final Rop
RETURN_VOID
{@code return void}
public static final Rop
RETURN_INT
{@code x: int; return x}
public static final Rop
RETURN_LONG
{@code x: long; return x}
public static final Rop
RETURN_FLOAT
{@code x: float; return x}
public static final Rop
RETURN_DOUBLE
{@code x: double; return x}
public static final Rop
RETURN_OBJECT
{@code x: Object; return x}
public static final Rop
ARRAY_LENGTH
{@code T: any type; r: int; x: T[]; :: r = x.length}
public static final Rop
THROW
{@code x: Throwable :: throw(x)}
public static final Rop
MONITOR_ENTER
{@code x: Object :: monitorenter(x)}
public static final Rop
MONITOR_EXIT
{@code x: Object :: monitorexit(x)}
public static final Rop
AGET_INT
{@code r,y: int; x: int[] :: r = x[y]}
public static final Rop
AGET_LONG
{@code r: long; x: long[]; y: int :: r = x[y]}
public static final Rop
AGET_FLOAT
{@code r: float; x: float[]; y: int :: r = x[y]}
public static final Rop
AGET_DOUBLE
{@code r: double; x: double[]; y: int :: r = x[y]}
public static final Rop
AGET_OBJECT
{@code r: Object; x: Object[]; y: int :: r = x[y]}
public static final Rop
AGET_BOOLEAN
{@code r: boolean; x: boolean[]; y: int :: r = x[y]}
public static final Rop
AGET_BYTE
{@code r: byte; x: byte[]; y: int :: r = x[y]}
public static final Rop
AGET_CHAR
{@code r: char; x: char[]; y: int :: r = x[y]}
public static final Rop
AGET_SHORT
{@code r: short; x: short[]; y: int :: r = x[y]}
public static final Rop
APUT_INT
{@code x,z: int; y: int[] :: y[z] = x}
public static final Rop
APUT_LONG
{@code x: long; y: long[]; z: int :: y[z] = x}
public static final Rop
APUT_FLOAT
{@code x: float; y: float[]; z: int :: y[z] = x}
public static final Rop
APUT_DOUBLE
{@code x: double; y: double[]; z: int :: y[z] = x}
public static final Rop
APUT_OBJECT
{@code x: Object; y: Object[]; z: int :: y[z] = x}
public static final Rop
APUT_BOOLEAN
{@code x: boolean; y: boolean[]; z: int :: y[z] = x}
public static final Rop
APUT_BYTE
{@code x: byte; y: byte[]; z: int :: y[z] = x}
public static final Rop
APUT_CHAR
{@code x: char; y: char[]; z: int :: y[z] = x}
public static final Rop
APUT_SHORT
{@code x: short; y: short[]; z: int :: y[z] = x}
public static final Rop
NEW_INSTANCE
{@code T: any non-array object type :: r = alloc(T)} (allocate heap space for an object)
public static final Rop
NEW_ARRAY_INT
{@code r: int[]; x: int :: r = new int[x]}
public static final Rop
NEW_ARRAY_LONG
{@code r: long[]; x: int :: r = new long[x]}
public static final Rop
NEW_ARRAY_FLOAT
{@code r: float[]; x: int :: r = new float[x]}
public static final Rop
NEW_ARRAY_DOUBLE
{@code r: double[]; x: int :: r = new double[x]}
public static final Rop
NEW_ARRAY_BOOLEAN
{@code r: boolean[]; x: int :: r = new boolean[x]}
public static final Rop
NEW_ARRAY_BYTE
{@code r: byte[]; x: int :: r = new byte[x]}
public static final Rop
NEW_ARRAY_CHAR
{@code r: char[]; x: int :: r = new char[x]}
public static final Rop
NEW_ARRAY_SHORT
{@code r: short[]; x: int :: r = new short[x]}
public static final Rop
CHECK_CAST
{@code T: any non-array object type; x: Object :: (T) x} (can throw {@code ClassCastException})
public static final Rop
INSTANCE_OF
{@code T: any non-array object type; x: Object :: x instanceof T}. Note: This is listed as throwing {@code Error} explicitly because the op can throw, but there are no other predefined exceptions for it.
public static final Rop
GET_FIELD_INT
{@code r: int; x: Object; f: instance field spec of type int :: r = x.f}
public static final Rop
GET_FIELD_LONG
{@code r: long; x: Object; f: instance field spec of type long :: r = x.f}
public static final Rop
GET_FIELD_FLOAT
{@code r: float; x: Object; f: instance field spec of type float :: r = x.f}
public static final Rop
GET_FIELD_DOUBLE
{@code r: double; x: Object; f: instance field spec of type double :: r = x.f}
public static final Rop
GET_FIELD_OBJECT
{@code r: Object; x: Object; f: instance field spec of type Object :: r = x.f}
public static final Rop
GET_FIELD_BOOLEAN
{@code r: boolean; x: Object; f: instance field spec of type boolean :: r = x.f}
public static final Rop
GET_FIELD_BYTE
{@code r: byte; x: Object; f: instance field spec of type byte :: r = x.f}
public static final Rop
GET_FIELD_CHAR
{@code r: char; x: Object; f: instance field spec of type char :: r = x.f}
public static final Rop
GET_FIELD_SHORT
{@code r: short; x: Object; f: instance field spec of type short :: r = x.f}
public static final Rop
GET_STATIC_INT
{@code r: int; f: static field spec of type int :: r = f}
public static final Rop
GET_STATIC_LONG
{@code r: long; f: static field spec of type long :: r = f}
public static final Rop
GET_STATIC_FLOAT
{@code r: float; f: static field spec of type float :: r = f}
public static final Rop
GET_STATIC_DOUBLE
{@code r: double; f: static field spec of type double :: r = f}
public static final Rop
GET_STATIC_OBJECT
{@code r: Object; f: static field spec of type Object :: r = f}
public static final Rop
GET_STATIC_BOOLEAN
{@code r: boolean; f: static field spec of type boolean :: r = f}
public static final Rop
GET_STATIC_BYTE
{@code r: byte; f: static field spec of type byte :: r = f}
public static final Rop
GET_STATIC_CHAR
{@code r: char; f: static field spec of type char :: r = f}
public static final Rop
GET_STATIC_SHORT
{@code r: short; f: static field spec of type short :: r = f}
public static final Rop
PUT_FIELD_INT
{@code x: int; y: Object; f: instance field spec of type int :: y.f = x}
public static final Rop
PUT_FIELD_LONG
{@code x: long; y: Object; f: instance field spec of type long :: y.f = x}
public static final Rop
PUT_FIELD_FLOAT
{@code x: float; y: Object; f: instance field spec of type float :: y.f = x}
public static final Rop
PUT_FIELD_DOUBLE
{@code x: double; y: Object; f: instance field spec of type double :: y.f = x}
public static final Rop
PUT_FIELD_OBJECT
{@code x: Object; y: Object; f: instance field spec of type Object :: y.f = x}
public static final Rop
PUT_FIELD_BOOLEAN
{@code x: int; y: Object; f: instance field spec of type boolean :: y.f = x}
public static final Rop
PUT_FIELD_BYTE
{@code x: int; y: Object; f: instance field spec of type byte :: y.f = x}
public static final Rop
PUT_FIELD_CHAR
{@code x: int; y: Object; f: instance field spec of type char :: y.f = x}
public static final Rop
PUT_FIELD_SHORT
{@code x: int; y: Object; f: instance field spec of type short :: y.f = x}
public static final Rop
PUT_STATIC_INT
{@code f: static field spec of type int; x: int :: f = x}
public static final Rop
PUT_STATIC_LONG
{@code f: static field spec of type long; x: long :: f = x}
public static final Rop
PUT_STATIC_FLOAT
{@code f: static field spec of type float; x: float :: f = x}
public static final Rop
PUT_STATIC_DOUBLE
{@code f: static field spec of type double; x: double :: f = x}
public static final Rop
PUT_STATIC_OBJECT
{@code f: static field spec of type Object; x: Object :: f = x}
public static final Rop
PUT_STATIC_BOOLEAN
{@code f: static field spec of type boolean; x: boolean :: f = x}
public static final Rop
PUT_STATIC_BYTE
{@code f: static field spec of type byte; x: byte :: f = x}
public static final Rop
PUT_STATIC_CHAR
{@code f: static field spec of type char; x: char :: f = x}
public static final Rop
PUT_STATIC_SHORT
{@code f: static field spec of type short; x: short :: f = x}
public static final Rop
MARK_LOCAL_INT
{@code x: Int :: local variable begins in x}
public static final Rop
MARK_LOCAL_LONG
{@code x: Long :: local variable begins in x}
public static final Rop
MARK_LOCAL_FLOAT
{@code x: Float :: local variable begins in x}
public static final Rop
MARK_LOCAL_DOUBLE
{@code x: Double :: local variable begins in x}
public static final Rop
MARK_LOCAL_OBJECT
{@code x: Object :: local variable begins in x}
public static final Rop
FILL_ARRAY_DATA
{@code T: Any primitive type; v0..vx: T :: {v0, ..., vx}}
Constructors Summary
private Rops()
This class is uninstantiable.

        // This space intentionally left blank.
    
Methods Summary
public static RopopAdd(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code add} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, ADD_CONST_INT, ADD_CONST_LONG,
                            ADD_CONST_FLOAT, ADD_CONST_DOUBLE, ADD_INT,
                            ADD_LONG, ADD_FLOAT, ADD_DOUBLE);
    
public static RopopAget(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code aget} rop for the given type. The result is a shared instance.

param
type {@code non-null;} element type of array being accessed
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return AGET_INT;
            case Type.BT_LONG:    return AGET_LONG;
            case Type.BT_FLOAT:   return AGET_FLOAT;
            case Type.BT_DOUBLE:  return AGET_DOUBLE;
            case Type.BT_OBJECT:  return AGET_OBJECT;
            case Type.BT_BOOLEAN: return AGET_BOOLEAN;
            case Type.BT_BYTE:    return AGET_BYTE;
            case Type.BT_CHAR:    return AGET_CHAR;
            case Type.BT_SHORT:   return AGET_SHORT;
        }

        return throwBadType(type);
    
public static RopopAnd(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code and} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, AND_CONST_INT, AND_CONST_LONG, null, null,
                            AND_INT, AND_LONG, null, null);
    
public static RopopAput(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code aput} rop for the given type. The result is a shared instance.

param
type {@code non-null;} element type of array being accessed
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return APUT_INT;
            case Type.BT_LONG:    return APUT_LONG;
            case Type.BT_FLOAT:   return APUT_FLOAT;
            case Type.BT_DOUBLE:  return APUT_DOUBLE;
            case Type.BT_OBJECT:  return APUT_OBJECT;
            case Type.BT_BOOLEAN: return APUT_BOOLEAN;
            case Type.BT_BYTE:    return APUT_BYTE;
            case Type.BT_CHAR:    return APUT_CHAR;
            case Type.BT_SHORT:   return APUT_SHORT;
        }

        return throwBadType(type);
    
public static RopopCmpg(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code cmpg} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being compared
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_FLOAT:  return CMPG_FLOAT;
            case Type.BT_DOUBLE: return CMPG_DOUBLE;
        }

        return throwBadType(type);
    
public static RopopCmpl(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code cmpl} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being compared
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_LONG:   return CMPL_LONG;
            case Type.BT_FLOAT:  return CMPL_FLOAT;
            case Type.BT_DOUBLE: return CMPL_DOUBLE;
        }

        return throwBadType(type);
    
public static RopopConst(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code const} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of the constant
return
{@code non-null;} an appropriate instance

        if (type.getType() == Type.KNOWN_NULL) {
            return CONST_OBJECT_NOTHROW;
        }

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return CONST_INT;
            case Type.BT_LONG:   return CONST_LONG;
            case Type.BT_FLOAT:  return CONST_FLOAT;
            case Type.BT_DOUBLE: return CONST_DOUBLE;
            case Type.BT_OBJECT: return CONST_OBJECT;
        }

        return throwBadType(type);
    
public static RopopConv(com.android.dx.rop.type.TypeBearer dest, com.android.dx.rop.type.TypeBearer source)
Returns the appropriate {@code conv} rop for the given types. The result is a shared instance.

param
dest {@code non-null;} target value type
param
source {@code non-null;} source value type
return
{@code non-null;} an appropriate instance

        int dbt = dest.getBasicFrameType();
        switch (source.getBasicFrameType()) {
            case Type.BT_INT: {
                switch (dbt) {
                    case Type.BT_LONG:   return CONV_I2L;
                    case Type.BT_FLOAT:  return CONV_I2F;
                    case Type.BT_DOUBLE: return CONV_I2D;
                    default:             break;
                }
            }
            case Type.BT_LONG: {
                switch (dbt) {
                    case Type.BT_INT:    return CONV_L2I;
                    case Type.BT_FLOAT:  return CONV_L2F;
                    case Type.BT_DOUBLE: return CONV_L2D;
                    default:             break;
                }
            }
            case Type.BT_FLOAT: {
                switch (dbt) {
                    case Type.BT_INT:    return CONV_F2I;
                    case Type.BT_LONG:   return CONV_F2L;
                    case Type.BT_DOUBLE: return CONV_F2D;
                    default:             break;
                }
            }
            case Type.BT_DOUBLE: {
                switch (dbt) {
                    case Type.BT_INT:    return CONV_D2I;
                    case Type.BT_LONG:   return CONV_D2L;
                    case Type.BT_FLOAT:  return CONV_D2F;
                    default:             break;
                }
            }
        }

        return throwBadTypes(StdTypeList.make(dest.getType(),
                                              source.getType()));
    
public static RopopDiv(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code div} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, DIV_CONST_INT, DIV_CONST_LONG,
                            DIV_CONST_FLOAT, DIV_CONST_DOUBLE, DIV_INT,
                            DIV_LONG, DIV_FLOAT, DIV_DOUBLE);
    
public static RopopFilledNewArray(com.android.dx.rop.type.TypeBearer arrayType, int count)
Returns the appropriate {@code filled-new-array} rop for the given type. The result may be a shared instance.

param
arrayType {@code non-null;} type of array being created
param
count {@code >= 0;} number of elements that the array should have
return
{@code non-null;} an appropriate instance

        Type type = arrayType.getType();
        Type elementType = type.getComponentType();

        if (elementType.isCategory2()) {
            return throwBadType(arrayType);
        }

        if (count < 0) {
            throw new IllegalArgumentException("count < 0");
        }

        StdTypeList sourceTypes = new StdTypeList(count);

        for (int i = 0; i < count; i++) {
            sourceTypes.set(i, elementType);
        }

        // Note: The resulting rop is considered call-like.
        return new Rop(RegOps.FILLED_NEW_ARRAY,
                       sourceTypes,
                       Exceptions.LIST_Error);
    
public static RopopGetField(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code get-field} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of the field in question
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return GET_FIELD_INT;
            case Type.BT_LONG:    return GET_FIELD_LONG;
            case Type.BT_FLOAT:   return GET_FIELD_FLOAT;
            case Type.BT_DOUBLE:  return GET_FIELD_DOUBLE;
            case Type.BT_OBJECT:  return GET_FIELD_OBJECT;
            case Type.BT_BOOLEAN: return GET_FIELD_BOOLEAN;
            case Type.BT_BYTE:    return GET_FIELD_BYTE;
            case Type.BT_CHAR:    return GET_FIELD_CHAR;
            case Type.BT_SHORT:   return GET_FIELD_SHORT;
        }

        return throwBadType(type);
    
public static RopopGetStatic(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code get-static} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of the field in question
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return GET_STATIC_INT;
            case Type.BT_LONG:    return GET_STATIC_LONG;
            case Type.BT_FLOAT:   return GET_STATIC_FLOAT;
            case Type.BT_DOUBLE:  return GET_STATIC_DOUBLE;
            case Type.BT_OBJECT:  return GET_STATIC_OBJECT;
            case Type.BT_BOOLEAN: return GET_STATIC_BOOLEAN;
            case Type.BT_BYTE:    return GET_STATIC_BYTE;
            case Type.BT_CHAR:    return GET_STATIC_CHAR;
            case Type.BT_SHORT:   return GET_STATIC_SHORT;
        }

        return throwBadType(type);
    
public static RopopIfEq(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-eq} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_EQZ_INT, IF_EQZ_OBJECT,
                      IF_EQ_INT, IF_EQ_OBJECT);
    
public static RopopIfGe(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-ge} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_GEZ_INT, null, IF_GE_INT, null);
    
public static RopopIfGt(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-gt} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_GTZ_INT, null, IF_GT_INT, null);
    
public static RopopIfLe(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-le} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_LEZ_INT, null, IF_LE_INT, null);
    
public static RopopIfLt(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-lt} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_LTZ_INT, null, IF_LT_INT, null);
    
public static RopopIfNe(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code if-ne} rop for the given sources. The result is a shared instance.

param
types {@code non-null;} source types
return
{@code non-null;} an appropriate instance

        return pickIf(types, IF_NEZ_INT, IF_NEZ_OBJECT,
                      IF_NE_INT, IF_NE_OBJECT);
    
public static RopopInvokeDirect(com.android.dx.rop.type.Prototype meth)
Returns the appropriate {@code invoke-direct} rop for the given type. The result is typically a newly-allocated instance.

param
meth {@code non-null;} descriptor of the method, including the {@code this} parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.INVOKE_DIRECT,
                       meth.getParameterFrameTypes(),
                       StdTypeList.THROWABLE);
    
public static RopopInvokeInterface(com.android.dx.rop.type.Prototype meth)
Returns the appropriate {@code invoke-interface} rop for the given type. The result is typically a newly-allocated instance.

param
meth {@code non-null;} descriptor of the method, including the {@code this} parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.INVOKE_INTERFACE,
                       meth.getParameterFrameTypes(),
                       StdTypeList.THROWABLE);
    
public static RopopInvokeStatic(com.android.dx.rop.type.Prototype meth)
Returns the appropriate {@code invoke-static} rop for the given type. The result is typically a newly-allocated instance.

param
meth {@code non-null;} descriptor of the method
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.INVOKE_STATIC,
                       meth.getParameterFrameTypes(),
                       StdTypeList.THROWABLE);
    
public static RopopInvokeSuper(com.android.dx.rop.type.Prototype meth)
Returns the appropriate {@code invoke-super} rop for the given type. The result is typically a newly-allocated instance.

param
meth {@code non-null;} descriptor of the method, including the {@code this} parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.INVOKE_SUPER,
                       meth.getParameterFrameTypes(),
                       StdTypeList.THROWABLE);
    
public static RopopInvokeVirtual(com.android.dx.rop.type.Prototype meth)
Returns the appropriate {@code invoke-virtual} rop for the given type. The result is typically a newly-allocated instance.

param
meth {@code non-null;} descriptor of the method, including the {@code this} parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.INVOKE_VIRTUAL,
                       meth.getParameterFrameTypes(),
                       StdTypeList.THROWABLE);
    
public static RopopMarkLocal(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code mark-local} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being marked
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return MARK_LOCAL_INT;
            case Type.BT_LONG:   return MARK_LOCAL_LONG;
            case Type.BT_FLOAT:  return MARK_LOCAL_FLOAT;
            case Type.BT_DOUBLE: return MARK_LOCAL_DOUBLE;
            case Type.BT_OBJECT: return MARK_LOCAL_OBJECT;
        }

        return throwBadType(type);
    
public static RopopMove(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code move} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being moved
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return MOVE_INT;
            case Type.BT_LONG:   return MOVE_LONG;
            case Type.BT_FLOAT:  return MOVE_FLOAT;
            case Type.BT_DOUBLE: return MOVE_DOUBLE;
            case Type.BT_OBJECT: return MOVE_OBJECT;
            case Type.BT_ADDR:   return MOVE_RETURN_ADDRESS;
        }

        return throwBadType(type);
    
public static RopopMoveException(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code move-exception} rop for the given type. The result may be a shared instance.

param
type {@code non-null;} type of the exception
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.MOVE_EXCEPTION, type.getType(),
                       StdTypeList.EMPTY, (String) null);
    
public static RopopMoveParam(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code move-param} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being moved
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return MOVE_PARAM_INT;
            case Type.BT_LONG:   return MOVE_PARAM_LONG;
            case Type.BT_FLOAT:  return MOVE_PARAM_FLOAT;
            case Type.BT_DOUBLE: return MOVE_PARAM_DOUBLE;
            case Type.BT_OBJECT: return MOVE_PARAM_OBJECT;
        }

        return throwBadType(type);
    
public static RopopMoveResult(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code move-result} rop for the given type. The result may be a shared instance.

param
type {@code non-null;} type of the parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.MOVE_RESULT, type.getType(),
                       StdTypeList.EMPTY, (String) null);
    
public static RopopMoveResultPseudo(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code move-result-pseudo} rop for the given type. The result may be a shared instance.

param
type {@code non-null;} type of the parameter
return
{@code non-null;} an appropriate instance

        return new Rop(RegOps.MOVE_RESULT_PSEUDO, type.getType(),
                       StdTypeList.EMPTY, (String) null);
    
public static RopopMul(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code mul} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, MUL_CONST_INT, MUL_CONST_LONG,
                            MUL_CONST_FLOAT, MUL_CONST_DOUBLE, MUL_INT,
                            MUL_LONG, MUL_FLOAT, MUL_DOUBLE);
    
public static RopopNeg(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code neg} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being operated on
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return NEG_INT;
            case Type.BT_LONG:   return NEG_LONG;
            case Type.BT_FLOAT:  return NEG_FLOAT;
            case Type.BT_DOUBLE: return NEG_DOUBLE;
        }

        return throwBadType(type);
    
public static RopopNewArray(com.android.dx.rop.type.TypeBearer arrayType)
Returns the appropriate {@code new-array} rop for the given type. The result is a shared instance.

param
arrayType {@code non-null;} array type of array being created
return
{@code non-null;} an appropriate instance

        Type type = arrayType.getType();
        Type elementType = type.getComponentType();

        switch (elementType.getBasicType()) {
            case Type.BT_INT:     return NEW_ARRAY_INT;
            case Type.BT_LONG:    return NEW_ARRAY_LONG;
            case Type.BT_FLOAT:   return NEW_ARRAY_FLOAT;
            case Type.BT_DOUBLE:  return NEW_ARRAY_DOUBLE;
            case Type.BT_BOOLEAN: return NEW_ARRAY_BOOLEAN;
            case Type.BT_BYTE:    return NEW_ARRAY_BYTE;
            case Type.BT_CHAR:    return NEW_ARRAY_CHAR;
            case Type.BT_SHORT:   return NEW_ARRAY_SHORT;
            case Type.BT_OBJECT: {
                return new Rop(RegOps.NEW_ARRAY, type, StdTypeList.INT,
                        Exceptions.LIST_Error_NegativeArraySizeException,
                        "new-array-object");
            }
        }

        return throwBadType(type);
    
public static RopopNot(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code not} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being operated on
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:  return NOT_INT;
            case Type.BT_LONG: return NOT_LONG;
        }

        return throwBadType(type);
    
public static RopopOr(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code or} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, OR_CONST_INT, OR_CONST_LONG, null, null,
                            OR_INT, OR_LONG, null, null);
    
public static RopopPutField(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code put-field} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of the field in question
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return PUT_FIELD_INT;
            case Type.BT_LONG:    return PUT_FIELD_LONG;
            case Type.BT_FLOAT:   return PUT_FIELD_FLOAT;
            case Type.BT_DOUBLE:  return PUT_FIELD_DOUBLE;
            case Type.BT_OBJECT:  return PUT_FIELD_OBJECT;
            case Type.BT_BOOLEAN: return PUT_FIELD_BOOLEAN;
            case Type.BT_BYTE:    return PUT_FIELD_BYTE;
            case Type.BT_CHAR:    return PUT_FIELD_CHAR;
            case Type.BT_SHORT:   return PUT_FIELD_SHORT;
        }

        return throwBadType(type);
    
public static RopopPutStatic(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code put-static} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of the field in question
return
{@code non-null;} an appropriate instance

        switch (type.getBasicType()) {
            case Type.BT_INT:     return PUT_STATIC_INT;
            case Type.BT_LONG:    return PUT_STATIC_LONG;
            case Type.BT_FLOAT:   return PUT_STATIC_FLOAT;
            case Type.BT_DOUBLE:  return PUT_STATIC_DOUBLE;
            case Type.BT_OBJECT:  return PUT_STATIC_OBJECT;
            case Type.BT_BOOLEAN: return PUT_STATIC_BOOLEAN;
            case Type.BT_BYTE:    return PUT_STATIC_BYTE;
            case Type.BT_CHAR:    return PUT_STATIC_CHAR;
            case Type.BT_SHORT:   return PUT_STATIC_SHORT;
        }

        return throwBadType(type);
    
public static RopopRem(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code rem} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, REM_CONST_INT, REM_CONST_LONG,
                            REM_CONST_FLOAT, REM_CONST_DOUBLE, REM_INT,
                            REM_LONG, REM_FLOAT, REM_DOUBLE);
    
public static RopopReturn(com.android.dx.rop.type.TypeBearer type)
Returns the appropriate {@code return} rop for the given type. The result is a shared instance.

param
type {@code non-null;} type of value being returned
return
{@code non-null;} an appropriate instance

        switch (type.getBasicFrameType()) {
            case Type.BT_INT:    return RETURN_INT;
            case Type.BT_LONG:   return RETURN_LONG;
            case Type.BT_FLOAT:  return RETURN_FLOAT;
            case Type.BT_DOUBLE: return RETURN_DOUBLE;
            case Type.BT_OBJECT: return RETURN_OBJECT;
            case Type.BT_VOID:   return RETURN_VOID;
        }

        return throwBadType(type);
    
public static RopopShl(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code shl} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, SHL_CONST_INT, SHL_CONST_LONG, null, null,
                            SHL_INT, SHL_LONG, null, null);
    
public static RopopShr(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code shr} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, SHR_CONST_INT, SHR_CONST_LONG, null, null,
                            SHR_INT, SHR_LONG, null, null);
    
public static RopopSub(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code sub} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, SUB_CONST_INT, SUB_CONST_LONG,
                            SUB_CONST_FLOAT, SUB_CONST_DOUBLE, SUB_INT,
                            SUB_LONG, SUB_FLOAT, SUB_DOUBLE);
    
public static RopopUshr(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code ushr} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, USHR_CONST_INT, USHR_CONST_LONG, null, null,
                            USHR_INT, USHR_LONG, null, null);
    
public static RopopXor(com.android.dx.rop.type.TypeList types)
Returns the appropriate {@code xor} rop for the given types. The result is a shared instance.

param
types {@code non-null;} types of the sources
return
{@code non-null;} an appropriate instance

        return pickBinaryOp(types, XOR_CONST_INT, XOR_CONST_LONG, null, null,
                            XOR_INT, XOR_LONG, null, null);
    
private static RoppickBinaryOp(com.android.dx.rop.type.TypeList types, Rop int1, Rop long1, Rop float1, Rop double1, Rop int2, Rop long2, Rop float2, Rop double2)
Returns the appropriate binary arithmetic rop for the given type and arguments. The result is a shared instance.

param
types {@code non-null;} sources of the operation
param
int1 {@code non-null;} the int-to-constant rop
param
long1 {@code non-null;} the long-to-constant rop
param
float1 {@code null-ok;} the float-to-constant rop, if any
param
double1 {@code null-ok;} the double-to-constant rop, if any
param
int2 {@code non-null;} the int-to-int rop
param
long2 {@code non-null;} the long-to-long or long-to-int rop
param
float2 {@code null-ok;} the float-to-float rop, if any
param
double2 {@code null-ok;} the double-to-double rop, if any
return
{@code non-null;} an appropriate instance

        int bt1 = types.getType(0).getBasicFrameType();
        Rop result = null;

        switch (types.size()) {
            case 1: {
                switch(bt1) {
                    case Type.BT_INT:    return int1;
                    case Type.BT_LONG:   return long1;
                    case Type.BT_FLOAT:  result = float1; break;
                    case Type.BT_DOUBLE: result = double1; break;
                }
                break;
            }
            case 2: {
                switch(bt1) {
                    case Type.BT_INT:    return int2;
                    case Type.BT_LONG:   return long2;
                    case Type.BT_FLOAT:  result = float2; break;
                    case Type.BT_DOUBLE: result = double2; break;
                }
                break;
            }
        }

        if (result == null) {
            return throwBadTypes(types);
        }

        return result;
    
private static RoppickIf(com.android.dx.rop.type.TypeList types, Rop intZ, Rop objZ, Rop intInt, Rop objObj)
Helper for all the {@code if*}-related methods, which checks types and picks one of the four variants, throwing if there's a problem.

param
types {@code non-null;} the types
param
intZ {@code non-null;} the int-to-0 comparison
param
objZ {@code null-ok;} the object-to-null comparison
param
intInt {@code non-null;} the int-to-int comparison
param
objObj {@code non-null;} the object-to-object comparison
return
{@code non-null;} the appropriate instance

        switch(types.size()) {
            case 1: {
                switch (types.getType(0).getBasicFrameType()) {
                    case Type.BT_INT: {
                        return intZ;
                    }
                    case Type.BT_OBJECT: {
                        if (objZ != null) {
                            return objZ;
                        }
                    }
                }
                break;
            }
            case 2: {
                int bt = types.getType(0).getBasicFrameType();
                if (bt == types.getType(1).getBasicFrameType()) {
                    switch (bt) {
                        case Type.BT_INT: {
                            return intInt;
                        }
                        case Type.BT_OBJECT: {
                            if (objObj != null) {
                                return objObj;
                            }
                        }
                    }
                }
                break;
            }
        }

        return throwBadTypes(types);
    
public static RopropFor(int opcode, com.android.dx.rop.type.TypeBearer dest, com.android.dx.rop.type.TypeList sources, com.android.dx.rop.cst.Constant cst)
Returns the appropriate rop for the given opcode, destination, and sources. The result is typically, but not necessarily, a shared instance.

Note: This method does not do complete error checking on its arguments, and so it may return an instance which seemed "right enough" even though in actuality the passed arguments don't quite match what is returned. TODO: Revisit this issue.

param
opcode the opcode
param
dest {@code non-null;} destination (result) type, or {@link Type#VOID} if none
param
sources {@code non-null;} list of source types
param
cst {@code null-ok;} associated constant, if any
return
{@code non-null;} an appropriate instance


                                                                                                            
            
              
        switch (opcode) {
            case RegOps.NOP: return NOP;
            case RegOps.MOVE: return opMove(dest);
            case RegOps.MOVE_PARAM: return opMoveParam(dest);
            case RegOps.MOVE_EXCEPTION: return opMoveException(dest);
            case RegOps.CONST: return opConst(dest);
            case RegOps.GOTO: return GOTO;
            case RegOps.IF_EQ: return opIfEq(sources);
            case RegOps.IF_NE: return opIfNe(sources);
            case RegOps.IF_LT: return opIfLt(sources);
            case RegOps.IF_GE: return opIfGe(sources);
            case RegOps.IF_LE: return opIfLe(sources);
            case RegOps.IF_GT: return opIfGt(sources);
            case RegOps.SWITCH: return SWITCH;
            case RegOps.ADD: return opAdd(sources);
            case RegOps.SUB: return opSub(sources);
            case RegOps.MUL: return opMul(sources);
            case RegOps.DIV: return opDiv(sources);
            case RegOps.REM: return opRem(sources);
            case RegOps.NEG: return opNeg(dest);
            case RegOps.AND: return opAnd(sources);
            case RegOps.OR: return opOr(sources);
            case RegOps.XOR: return opXor(sources);
            case RegOps.SHL: return opShl(sources);
            case RegOps.SHR: return opShr(sources);
            case RegOps.USHR: return opUshr(sources);
            case RegOps.NOT: return opNot(dest);
            case RegOps.CMPL: return opCmpl(sources.getType(0));
            case RegOps.CMPG: return opCmpg(sources.getType(0));
            case RegOps.CONV: return opConv(dest, sources.getType(0));
            case RegOps.TO_BYTE: return TO_BYTE;
            case RegOps.TO_CHAR: return TO_CHAR;
            case RegOps.TO_SHORT: return TO_SHORT;
            case RegOps.RETURN: {
                if (sources.size() == 0) {
                    return RETURN_VOID;
                }
                return opReturn(sources.getType(0));
            }
            case RegOps.ARRAY_LENGTH: return ARRAY_LENGTH;
            case RegOps.THROW: return THROW;
            case RegOps.MONITOR_ENTER: return MONITOR_ENTER;
            case RegOps.MONITOR_EXIT: return MONITOR_EXIT;
            case RegOps.AGET: {
                Type source = sources.getType(0);
                Type componentType;
                if (source == Type.KNOWN_NULL) {
                    /*
                     * Treat a known-null as an array of the expected
                     * result type.
                     */
                    componentType = dest.getType();
                } else {
                    componentType = source.getComponentType();
                }
                return opAget(componentType);
            }
            case RegOps.APUT: {
                Type source = sources.getType(1);
                Type componentType;
                if (source == Type.KNOWN_NULL) {
                    /*
                     * Treat a known-null as an array of the type being
                     * stored.
                     */
                    componentType = sources.getType(0);
                } else {
                    componentType = source.getComponentType();
                }
                return opAput(componentType);
            }
            case RegOps.NEW_INSTANCE: return NEW_INSTANCE;
            case RegOps.NEW_ARRAY: return opNewArray(dest.getType());
            case RegOps.CHECK_CAST: return CHECK_CAST;
            case RegOps.INSTANCE_OF: return INSTANCE_OF;
            case RegOps.GET_FIELD: return opGetField(dest);
            case RegOps.GET_STATIC: return opGetStatic(dest);
            case RegOps.PUT_FIELD: return opPutField(sources.getType(0));
            case RegOps.PUT_STATIC: return opPutStatic(sources.getType(0));
            case RegOps.INVOKE_STATIC: {
                return opInvokeStatic(((CstMethodRef) cst).getPrototype());
            }
            case RegOps.INVOKE_VIRTUAL: {
                CstBaseMethodRef cstMeth = (CstMethodRef) cst;
                Prototype meth = cstMeth.getPrototype();
                CstType definer = cstMeth.getDefiningClass();
                meth = meth.withFirstParameter(definer.getClassType());
                return opInvokeVirtual(meth);
            }
            case RegOps.INVOKE_SUPER: {
                CstBaseMethodRef cstMeth = (CstMethodRef) cst;
                Prototype meth = cstMeth.getPrototype();
                CstType definer = cstMeth.getDefiningClass();
                meth = meth.withFirstParameter(definer.getClassType());
                return opInvokeSuper(meth);
            }
            case RegOps.INVOKE_DIRECT: {
                CstBaseMethodRef cstMeth = (CstMethodRef) cst;
                Prototype meth = cstMeth.getPrototype();
                CstType definer = cstMeth.getDefiningClass();
                meth = meth.withFirstParameter(definer.getClassType());
                return opInvokeDirect(meth);
            }
            case RegOps.INVOKE_INTERFACE: {
                CstBaseMethodRef cstMeth = (CstMethodRef) cst;
                Prototype meth = cstMeth.getPrototype();
                CstType definer = cstMeth.getDefiningClass();
                meth = meth.withFirstParameter(definer.getClassType());
                return opInvokeInterface(meth);
            }
        }

        throw new RuntimeException("unknown opcode " + RegOps.opName(opcode));
    
private static RopthrowBadType(com.android.dx.rop.type.TypeBearer type)
Throws the right exception to complain about a bogus type.

param
type {@code non-null;} the bad type
return
never

        throw new IllegalArgumentException("bad type: " + type);
    
private static RopthrowBadTypes(com.android.dx.rop.type.TypeList types)
Throws the right exception to complain about a bogus list of types.

param
types {@code non-null;} the bad types
return
never

        throw new IllegalArgumentException("bad types: " + types);