Fields Summary |
---|
public static final Rop | NOPnop() |
public static final Rop | MOVE_INTr,x: int :: r = x; |
public static final Rop | MOVE_LONGr,x: long :: r = x; |
public static final Rop | MOVE_FLOATr,x: float :: r = x; |
public static final Rop | MOVE_DOUBLEr,x: double :: r = x; |
public static final Rop | MOVE_OBJECTr,x: Object :: r = x; |
public static final Rop | MOVE_RETURN_ADDRESSr,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_INTr,param(x): int :: r = param(x); |
public static final Rop | MOVE_PARAM_LONGr,param(x): long :: r = param(x); |
public static final Rop | MOVE_PARAM_FLOATr,param(x): float :: r = param(x); |
public static final Rop | MOVE_PARAM_DOUBLEr,param(x): double :: r = param(x); |
public static final Rop | MOVE_PARAM_OBJECTr,param(x): Object :: r = param(x); |
public static final Rop | CONST_INTr, literal: int :: r = literal; |
public static final Rop | CONST_LONGr, literal: long :: r = literal; |
public static final Rop | CONST_FLOATr, literal: float :: r = literal; |
public static final Rop | CONST_DOUBLEr, literal: double :: r = literal; |
public static final Rop | CONST_OBJECTr, literal: Object :: r = literal; |
public static final Rop | CONST_OBJECT_NOTHROWr, literal: Object :: r = literal; |
public static final Rop | GOTOgoto label |
public static final Rop | IF_EQZ_INTx: int :: if (x == 0) goto label |
public static final Rop | IF_NEZ_INTx: int :: if (x != 0) goto label |
public static final Rop | IF_LTZ_INTx: int :: if (x < 0) goto label |
public static final Rop | IF_GEZ_INTx: int :: if (x >= 0) goto label |
public static final Rop | IF_LEZ_INTx: int :: if (x <= 0) goto label |
public static final Rop | IF_GTZ_INTx: int :: if (x > 0) goto label |
public static final Rop | IF_EQZ_OBJECTx: Object :: if (x == null) goto label |
public static final Rop | IF_NEZ_OBJECTx: Object :: if (x != null) goto label |
public static final Rop | IF_EQ_INTx,y: int :: if (x == y) goto label |
public static final Rop | IF_NE_INTx,y: int :: if (x != y) goto label |
public static final Rop | IF_LT_INTx,y: int :: if (x < y) goto label |
public static final Rop | IF_GE_INTx,y: int :: if (x >= y) goto label |
public static final Rop | IF_LE_INTx,y: int :: if (x <= y) goto label |
public static final Rop | IF_GT_INTx,y: int :: if (x > y) goto label |
public static final Rop | IF_EQ_OBJECTx,y: Object :: if (x == y) goto label |
public static final Rop | IF_NE_OBJECTx,y: Object :: if (x != y) goto label |
public static final Rop | SWITCHx: int :: goto switchtable[x] |
public static final Rop | ADD_INTr,x,y: int :: r = x + y; |
public static final Rop | ADD_LONGr,x,y: long :: r = x + y; |
public static final Rop | ADD_FLOATr,x,y: float :: r = x + y; |
public static final Rop | ADD_DOUBLEr,x,y: double :: r = x + y; |
public static final Rop | SUB_INTr,x,y: int :: r = x - y; |
public static final Rop | SUB_LONGr,x,y: long :: r = x - y; |
public static final Rop | SUB_FLOATr,x,y: float :: r = x - y; |
public static final Rop | SUB_DOUBLEr,x,y: double :: r = x - y; |
public static final Rop | MUL_INTr,x,y: int :: r = x * y; |
public static final Rop | MUL_LONGr,x,y: long :: r = x * y; |
public static final Rop | MUL_FLOATr,x,y: float :: r = x * y; |
public static final Rop | MUL_DOUBLEr,x,y: double :: r = x * y; |
public static final Rop | DIV_INTr,x,y: int :: r = x / y; |
public static final Rop | DIV_LONGr,x,y: long :: r = x / y; |
public static final Rop | DIV_FLOATr,x,y: float :: r = x / y; |
public static final Rop | DIV_DOUBLEr,x,y: double :: r = x / y; |
public static final Rop | REM_INTr,x,y: int :: r = x % y; |
public static final Rop | REM_LONGr,x,y: long :: r = x % y; |
public static final Rop | REM_FLOATr,x,y: float :: r = x % y; |
public static final Rop | REM_DOUBLEr,x,y: double :: r = x % y; |
public static final Rop | NEG_INTr,x: int :: r = -x; |
public static final Rop | NEG_LONGr,x: long :: r = -x; |
public static final Rop | NEG_FLOATr,x: float :: r = -x; |
public static final Rop | NEG_DOUBLEr,x: double :: r = -x; |
public static final Rop | AND_INTr,x,y: int :: r = x & y; |
public static final Rop | AND_LONGr,x,y: long :: r = x & y; |
public static final Rop | OR_INTr,x,y: int :: r = x | y; |
public static final Rop | OR_LONGr,x,y: long :: r = x | y; |
public static final Rop | XOR_INTr,x,y: int :: r = x ^ y; |
public static final Rop | XOR_LONGr,x,y: long :: r = x ^ y; |
public static final Rop | SHL_INTr,x,y: int :: r = x << y; |
public static final Rop | SHL_LONGr,x: long; y: int :: r = x << y; |
public static final Rop | SHR_INTr,x,y: int :: r = x >> y; |
public static final Rop | SHR_LONGr,x: long; y: int :: r = x >> y; |
public static final Rop | USHR_INTr,x,y: int :: r = x >>> y; |
public static final Rop | USHR_LONGr,x: long; y: int :: r = x >>> y; |
public static final Rop | NOT_INTr,x: int :: r = ~x; |
public static final Rop | NOT_LONGr,x: long :: r = ~x; |
public static final Rop | ADD_CONST_INTr,x,c: int :: r = x + c; |
public static final Rop | ADD_CONST_LONGr,x,c: long :: r = x + c; |
public static final Rop | ADD_CONST_FLOATr,x,c: float :: r = x + c; |
public static final Rop | ADD_CONST_DOUBLEr,x,c: double :: r = x + c; |
public static final Rop | SUB_CONST_INTr,x,c: int :: r = x - c; |
public static final Rop | SUB_CONST_LONGr,x,c: long :: r = x - c; |
public static final Rop | SUB_CONST_FLOATr,x,c: float :: r = x - c; |
public static final Rop | SUB_CONST_DOUBLEr,x,c: double :: r = x - c; |
public static final Rop | MUL_CONST_INTr,x,c: int :: r = x * c; |
public static final Rop | MUL_CONST_LONGr,x,c: long :: r = x * c; |
public static final Rop | MUL_CONST_FLOATr,x,c: float :: r = x * c; |
public static final Rop | MUL_CONST_DOUBLEr,x,c: double :: r = x * c; |
public static final Rop | DIV_CONST_INTr,x,c: int :: r = x / c; |
public static final Rop | DIV_CONST_LONGr,x,c: long :: r = x / c; |
public static final Rop | DIV_CONST_FLOATr,x,c: float :: r = x / c; |
public static final Rop | DIV_CONST_DOUBLEr,x,c: double :: r = x / c; |
public static final Rop | REM_CONST_INTr,x,c: int :: r = x % c; |
public static final Rop | REM_CONST_LONGr,x,c: long :: r = x % c; |
public static final Rop | REM_CONST_FLOATr,x,c: float :: r = x % c; |
public static final Rop | REM_CONST_DOUBLEr,x,c: double :: r = x % c; |
public static final Rop | AND_CONST_INTr,x,c: int :: r = x & c; |
public static final Rop | AND_CONST_LONGr,x,c: long :: r = x & c; |
public static final Rop | OR_CONST_INTr,x,c: int :: r = x | c; |
public static final Rop | OR_CONST_LONGr,x,c: long :: r = x | c; |
public static final Rop | XOR_CONST_INTr,x,c: int :: r = x ^ c; |
public static final Rop | XOR_CONST_LONGr,x,c: long :: r = x ^ c; |
public static final Rop | SHL_CONST_INTr,x,c: int :: r = x << c; |
public static final Rop | SHL_CONST_LONGr,x: long; c: int :: r = x << c; |
public static final Rop | SHR_CONST_INTr,x,c: int :: r = x >> c; |
public static final Rop | SHR_CONST_LONGr,x: long; c: int :: r = x >> c; |
public static final Rop | USHR_CONST_INTr,x,c: int :: r = x >>> c; |
public static final Rop | USHR_CONST_LONGr,x: long; c: int :: r = x >>> c; |
public static final Rop | CMPL_LONGr: int; x,y: long :: r = cmp(x, y); |
public static final Rop | CMPL_FLOATr: int; x,y: float :: r = cmpl(x, y); |
public static final Rop | CMPL_DOUBLEr: int; x,y: double :: r = cmpl(x, y); |
public static final Rop | CMPG_FLOATr: int; x,y: float :: r = cmpg(x, y); |
public static final Rop | CMPG_DOUBLEr: int; x,y: double :: r = cmpg(x, y); |
public static final Rop | CONV_L2Ir: int; x: long :: r = (int) x |
public static final Rop | CONV_F2Ir: int; x: float :: r = (int) x |
public static final Rop | CONV_D2Ir: int; x: double :: r = (int) x |
public static final Rop | CONV_I2Lr: long; x: int :: r = (long) x |
public static final Rop | CONV_F2Lr: long; x: float :: r = (long) x |
public static final Rop | CONV_D2Lr: long; x: double :: r = (long) x |
public static final Rop | CONV_I2Fr: float; x: int :: r = (float) x |
public static final Rop | CONV_L2Fr: float; x: long :: r = (float) x |
public static final Rop | CONV_D2Fr: float; x: double :: r = (float) x |
public static final Rop | CONV_I2Dr: double; x: int :: r = (double) x |
public static final Rop | CONV_L2Dr: double; x: long :: r = (double) x |
public static final Rop | CONV_F2Dr: double; x: float :: r = (double) x |
public static final Rop | TO_BYTEr,x: int :: r = (x << 24) >> 24 (Java-style
convert int to byte) |
public static final Rop | TO_CHARr,x: int :: r = x & 0xffff (Java-style
convert int to char) |
public static final Rop | TO_SHORTr,x: int :: r = (x << 16) >> 16 (Java-style
convert int to short) |
public static final Rop | RETURN_VOIDreturn void |
public static final Rop | RETURN_INTx: int; return x |
public static final Rop | RETURN_LONGx: long; return x |
public static final Rop | RETURN_FLOATx: float; return x |
public static final Rop | RETURN_DOUBLEx: double; return x |
public static final Rop | RETURN_OBJECTx: Object; return x |
public static final Rop | ARRAY_LENGTHT: any type; r: int; x: T[]; :: r = x.length |
public static final Rop | THROWx: Throwable :: throw(x) |
public static final Rop | MONITOR_ENTERx: Object :: monitorenter(x) |
public static final Rop | MONITOR_EXITx: Object :: monitorexit(x) |
public static final Rop | AGET_INTr,y: int; x: int[] :: r = x[y] |
public static final Rop | AGET_LONGr: long; x: long[]; y: int :: r = x[y] |
public static final Rop | AGET_FLOATr: float; x: float[]; y: int :: r = x[y] |
public static final Rop | AGET_DOUBLEr: double; x: double[]; y: int :: r = x[y] |
public static final Rop | AGET_OBJECTr: Object; x: Object[]; y: int :: r = x[y] |
public static final Rop | AGET_BOOLEANr: boolean; x: boolean[]; y: int :: r = x[y] |
public static final Rop | AGET_BYTEr: byte; x: byte[]; y: int :: r = x[y] |
public static final Rop | AGET_CHARr: char; x: char[]; y: int :: r = x[y] |
public static final Rop | AGET_SHORTr: short; x: short[]; y: int :: r = x[y] |
public static final Rop | APUT_INTx,z: int; y: int[] :: y[z] = x |
public static final Rop | APUT_LONGx: long; y: long[]; z: int :: y[z] = x |
public static final Rop | APUT_FLOATx: float; y: float[]; z: int :: y[z] = x |
public static final Rop | APUT_DOUBLEx: double; y: double[]; z: int :: y[z] = x |
public static final Rop | APUT_OBJECTx: Object; y: Object[]; z: int :: y[z] = x |
public static final Rop | APUT_BOOLEANx: boolean; y: boolean[]; z: int :: y[z] = x |
public static final Rop | APUT_BYTEx: byte; y: byte[]; z: int :: y[z] = x |
public static final Rop | APUT_CHARx: char; y: char[]; z: int :: y[z] = x |
public static final Rop | APUT_SHORTx: short; y: short[]; z: int :: y[z] = x |
public static final Rop | NEW_INSTANCET: any non-array object type :: r =
alloc(T) (allocate heap space for an object) |
public static final Rop | NEW_ARRAY_INTr: int[]; x: int :: r = new int[x] |
public static final Rop | NEW_ARRAY_LONGr: long[]; x: int :: r = new long[x] |
public static final Rop | NEW_ARRAY_FLOATr: float[]; x: int :: r = new float[x] |
public static final Rop | NEW_ARRAY_DOUBLEr: double[]; x: int :: r = new double[x] |
public static final Rop | NEW_ARRAY_BOOLEANr: boolean[]; x: int :: r = new boolean[x] |
public static final Rop | NEW_ARRAY_BYTEr: byte[]; x: int :: r = new byte[x] |
public static final Rop | NEW_ARRAY_CHARr: char[]; x: int :: r = new char[x] |
public static final Rop | NEW_ARRAY_SHORTr: short[]; x: int :: r = new short[x] |
public static final Rop | CHECK_CASTT: any non-array object type; x: Object :: (T) x (can
throw ClassCastException ) |
public static final Rop | INSTANCE_OFT: any non-array object type; x: Object :: x instanceof
T . Note: This is listed as throwing Error
explicitly because the op can throw, but there are no
other predefined exceptions for it. |
public static final Rop | GET_FIELD_INTr: int; x: Object; f: instance field spec of
type int :: r = x.f |
public static final Rop | GET_FIELD_LONGr: long; x: Object; f: instance field spec of
type long :: r = x.f |
public static final Rop | GET_FIELD_FLOATr: float; x: Object; f: instance field spec of
type float :: r = x.f |
public static final Rop | GET_FIELD_DOUBLEr: double; x: Object; f: instance field spec of
type double :: r = x.f |
public static final Rop | GET_FIELD_OBJECTr: Object; x: Object; f: instance field spec of
type Object :: r = x.f |
public static final Rop | GET_FIELD_BOOLEANr: boolean; x: Object; f: instance field spec of
type boolean :: r = x.f |
public static final Rop | GET_FIELD_BYTEr: byte; x: Object; f: instance field spec of
type byte :: r = x.f |
public static final Rop | GET_FIELD_CHARr: char; x: Object; f: instance field spec of
type char :: r = x.f |
public static final Rop | GET_FIELD_SHORTr: short; x: Object; f: instance field spec of
type short :: r = x.f |
public static final Rop | GET_STATIC_INTr: int; f: static field spec of type int :: r =
f |
public static final Rop | GET_STATIC_LONGr: long; f: static field spec of type long :: r =
f |
public static final Rop | GET_STATIC_FLOATr: float; f: static field spec of type float :: r =
f |
public static final Rop | GET_STATIC_DOUBLEr: double; f: static field spec of type double :: r =
f |
public static final Rop | GET_STATIC_OBJECTr: Object; f: static field spec of type Object :: r =
f |
public static final Rop | GET_STATIC_BOOLEANr: boolean; f: static field spec of type boolean :: r =
f |
public static final Rop | GET_STATIC_BYTEr: byte; f: static field spec of type byte :: r =
f |
public static final Rop | GET_STATIC_CHARr: char; f: static field spec of type char :: r =
f |
public static final Rop | GET_STATIC_SHORTr: short; f: static field spec of type short :: r =
f |
public static final Rop | PUT_FIELD_INTx: int; y: Object; f: instance field spec of type
int :: y.f = x |
public static final Rop | PUT_FIELD_LONGx: long; y: Object; f: instance field spec of type
long :: y.f = x |
public static final Rop | PUT_FIELD_FLOATx: float; y: Object; f: instance field spec of type
float :: y.f = x |
public static final Rop | PUT_FIELD_DOUBLEx: double; y: Object; f: instance field spec of type
double :: y.f = x |
public static final Rop | PUT_FIELD_OBJECTx: Object; y: Object; f: instance field spec of type
Object :: y.f = x |
public static final Rop | PUT_FIELD_BOOLEANx: int; y: Object; f: instance field spec of type
boolean :: y.f = x |
public static final Rop | PUT_FIELD_BYTEx: int; y: Object; f: instance field spec of type
byte :: y.f = x |
public static final Rop | PUT_FIELD_CHARx: int; y: Object; f: instance field spec of type
char :: y.f = x |
public static final Rop | PUT_FIELD_SHORTx: int; y: Object; f: instance field spec of type
short :: y.f = x |
public static final Rop | PUT_STATIC_INTf: static field spec of type int; x: int :: f =
x |
public static final Rop | PUT_STATIC_LONGf: static field spec of type long; x: long :: f =
x |
public static final Rop | PUT_STATIC_FLOATf: static field spec of type float; x: float :: f =
x |
public static final Rop | PUT_STATIC_DOUBLEf: static field spec of type double; x: double :: f =
x |
public static final Rop | PUT_STATIC_OBJECTf: static field spec of type Object; x: Object :: f =
x |
public static final Rop | PUT_STATIC_BOOLEANf: static field spec of type boolean; x: boolean :: f =
x |
public static final Rop | PUT_STATIC_BYTEf: static field spec of type byte; x: byte :: f =
x |
public static final Rop | PUT_STATIC_CHARf: static field spec of type char; x: char :: f =
x |
public static final Rop | PUT_STATIC_SHORTf: static field spec of type short; x: short :: f =
x |
public static final Rop | MARK_LOCAL_INTx: Int :: local variable begins in x |
public static final Rop | MARK_LOCAL_LONGx: Long :: local variable begins in x |
public static final Rop | MARK_LOCAL_FLOATx: Float :: local variable begins in x |
public static final Rop | MARK_LOCAL_DOUBLEx: Double :: local variable begins in x |
public static final Rop | MARK_LOCAL_OBJECTx: Object :: local variable begins in x |
public static final Rop | FILL_ARRAY_DATAT: Any primitive type; v0..vx: T :: {v0, ..., vx} |
Methods Summary |
---|
public static Rop | opAdd(com.android.dx.rop.type.TypeList types)Returns the appropriate add rop for the given
types. The result is a shared 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 Rop | opAget(com.android.dx.rop.type.TypeBearer type)Returns the appropriate aget rop for the given type. The
result is a shared 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 Rop | opAnd(com.android.dx.rop.type.TypeList types)Returns the appropriate and rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, AND_CONST_INT, AND_CONST_LONG, null, null,
AND_INT, AND_LONG, null, null);
|
public static Rop | opAput(com.android.dx.rop.type.TypeBearer type)Returns the appropriate aput rop for the given type. The
result is a shared 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 Rop | opCmpg(com.android.dx.rop.type.TypeBearer type)Returns the appropriate cmpg rop for the given type. The
result is a shared instance.
switch (type.getBasicType()) {
case Type.BT_FLOAT: return CMPG_FLOAT;
case Type.BT_DOUBLE: return CMPG_DOUBLE;
}
return throwBadType(type);
|
public static Rop | opCmpl(com.android.dx.rop.type.TypeBearer type)Returns the appropriate cmpl rop for the given type. The
result is a shared 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 Rop | opConst(com.android.dx.rop.type.TypeBearer type)Returns the appropriate const rop for the given
type. The result is a shared 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 Rop | opConv(com.android.dx.rop.type.TypeBearer dest, com.android.dx.rop.type.TypeBearer source)Returns the appropriate conv rop for the given types. The
result is a shared 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;
}
}
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;
}
}
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;
}
}
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;
}
}
}
return throwBadTypes(StdTypeList.make(dest.getType(),
source.getType()));
|
public static Rop | opDiv(com.android.dx.rop.type.TypeList types)Returns the appropriate div rop for the given
types. The result is a shared 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 Rop | opFilledNewArray(com.android.dx.rop.type.TypeBearer arrayType, int count)Returns the appropriate filled-new-array rop for the given
type. The result may be a shared 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 Rop | opGetField(com.android.dx.rop.type.TypeBearer type)Returns the appropriate get-field rop for the given
type. The result is a shared 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 Rop | opGetStatic(com.android.dx.rop.type.TypeBearer type)Returns the appropriate get-static rop for the given
type. The result is a shared 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 Rop | opIfEq(com.android.dx.rop.type.TypeList types)Returns the appropriate if-eq rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_EQZ_INT, IF_EQZ_OBJECT,
IF_EQ_INT, IF_EQ_OBJECT);
|
public static Rop | opIfGe(com.android.dx.rop.type.TypeList types)Returns the appropriate if-ge rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_GEZ_INT, null, IF_GE_INT, null);
|
public static Rop | opIfGt(com.android.dx.rop.type.TypeList types)Returns the appropriate if-gt rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_GTZ_INT, null, IF_GT_INT, null);
|
public static Rop | opIfLe(com.android.dx.rop.type.TypeList types)Returns the appropriate if-le rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_LEZ_INT, null, IF_LE_INT, null);
|
public static Rop | opIfLt(com.android.dx.rop.type.TypeList types)Returns the appropriate if-lt rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_LTZ_INT, null, IF_LT_INT, null);
|
public static Rop | opIfNe(com.android.dx.rop.type.TypeList types)Returns the appropriate if-ne rop for the given
sources. The result is a shared instance.
return pickIf(types, IF_NEZ_INT, IF_NEZ_OBJECT,
IF_NE_INT, IF_NE_OBJECT);
|
public static Rop | opInvokeDirect(com.android.dx.rop.type.Prototype meth)Returns the appropriate invoke-direct rop for the
given type. The result is typically a newly-allocated instance.
return new Rop(RegOps.INVOKE_DIRECT,
meth.getParameterFrameTypes(),
StdTypeList.THROWABLE);
|
public static Rop | opInvokeInterface(com.android.dx.rop.type.Prototype meth)Returns the appropriate invoke-interface rop for the
given type. The result is typically a newly-allocated instance.
return new Rop(RegOps.INVOKE_INTERFACE,
meth.getParameterFrameTypes(),
StdTypeList.THROWABLE);
|
public static Rop | opInvokeStatic(com.android.dx.rop.type.Prototype meth)Returns the appropriate invoke-static rop for the
given type. The result is typically a newly-allocated instance.
return new Rop(RegOps.INVOKE_STATIC,
meth.getParameterFrameTypes(),
StdTypeList.THROWABLE);
|
public static Rop | opInvokeSuper(com.android.dx.rop.type.Prototype meth)Returns the appropriate invoke-super rop for the
given type. The result is typically a newly-allocated instance.
return new Rop(RegOps.INVOKE_SUPER,
meth.getParameterFrameTypes(),
StdTypeList.THROWABLE);
|
public static Rop | opInvokeVirtual(com.android.dx.rop.type.Prototype meth)Returns the appropriate invoke-virtual rop for the
given type. The result is typically a newly-allocated instance.
return new Rop(RegOps.INVOKE_VIRTUAL,
meth.getParameterFrameTypes(),
StdTypeList.THROWABLE);
|
public static Rop | opMarkLocal(com.android.dx.rop.type.TypeBearer type)Returns the appropriate mark-local rop for the given type.
The result is a shared 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 Rop | opMove(com.android.dx.rop.type.TypeBearer type)Returns the appropriate move rop for the given type. The
result is a shared 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 Rop | opMoveException(com.android.dx.rop.type.TypeBearer type)Returns the appropriate move-exception rop for the
given type. The result may be a shared instance.
return new Rop(RegOps.MOVE_EXCEPTION, type.getType(),
StdTypeList.EMPTY, (String) null);
|
public static Rop | opMoveParam(com.android.dx.rop.type.TypeBearer type)Returns the appropriate move-param rop for the
given type. The result is a shared 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 Rop | opMoveResult(com.android.dx.rop.type.TypeBearer type)Returns the appropriate move-result rop for the
given type. The result may be a shared instance.
return new Rop(RegOps.MOVE_RESULT, type.getType(),
StdTypeList.EMPTY, (String) null);
|
public static Rop | opMoveResultPseudo(com.android.dx.rop.type.TypeBearer type)Returns the appropriate move-result-pseudo rop for the
given type. The result may be a shared instance.
return new Rop(RegOps.MOVE_RESULT_PSEUDO, type.getType(),
StdTypeList.EMPTY, (String) null);
|
public static Rop | opMul(com.android.dx.rop.type.TypeList types)Returns the appropriate mul rop for the given
types. The result is a shared 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 Rop | opNeg(com.android.dx.rop.type.TypeBearer type)Returns the appropriate neg rop for the given type. The
result is a shared 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 Rop | opNewArray(com.android.dx.rop.type.TypeBearer arrayType)Returns the appropriate new-array rop for the given
type. The result is a shared 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 Rop | opNot(com.android.dx.rop.type.TypeBearer type)Returns the appropriate not rop for the given type. The
result is a shared instance.
switch (type.getBasicFrameType()) {
case Type.BT_INT: return NOT_INT;
case Type.BT_LONG: return NOT_LONG;
}
return throwBadType(type);
|
public static Rop | opOr(com.android.dx.rop.type.TypeList types)Returns the appropriate or rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, OR_CONST_INT, OR_CONST_LONG, null, null,
OR_INT, OR_LONG, null, null);
|
public static Rop | opPutField(com.android.dx.rop.type.TypeBearer type)Returns the appropriate put-field rop for the given
type. The result is a shared 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 Rop | opPutStatic(com.android.dx.rop.type.TypeBearer type)Returns the appropriate put-static rop for the given
type. The result is a shared 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 Rop | opRem(com.android.dx.rop.type.TypeList types)Returns the appropriate rem rop for the given
types. The result is a shared 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 Rop | opReturn(com.android.dx.rop.type.TypeBearer type)Returns the appropriate return rop for the given type. The
result is a shared 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 Rop | opShl(com.android.dx.rop.type.TypeList types)Returns the appropriate shl rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, SHL_CONST_INT, SHL_CONST_LONG, null, null,
SHL_INT, SHL_LONG, null, null);
|
public static Rop | opShr(com.android.dx.rop.type.TypeList types)Returns the appropriate shr rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, SHR_CONST_INT, SHR_CONST_LONG, null, null,
SHR_INT, SHR_LONG, null, null);
|
public static Rop | opSub(com.android.dx.rop.type.TypeList types)Returns the appropriate sub rop for the given
types. The result is a shared 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 Rop | opUshr(com.android.dx.rop.type.TypeList types)Returns the appropriate ushr rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, USHR_CONST_INT, USHR_CONST_LONG, null, null,
USHR_INT, USHR_LONG, null, null);
|
public static Rop | opXor(com.android.dx.rop.type.TypeList types)Returns the appropriate xor rop for the given
types. The result is a shared instance.
return pickBinaryOp(types, XOR_CONST_INT, XOR_CONST_LONG, null, null,
XOR_INT, XOR_LONG, null, null);
|
private static Rop | pickBinaryOp(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.
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 Rop | pickIf(com.android.dx.rop.type.TypeList types, Rop intZ, Rop objZ, Rop intInt, Rop objObj)Helper for all the if* -related methods, which
checks types and picks one of the four variants, throwing if
there's a problem.
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 Rop | ropFor(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.
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);
if (source == Type.KNOWN_NULL) {
// Treat a known-null as an Object[] in this context.
source = Type.OBJECT_ARRAY;
}
return opAget(source.getComponentType());
}
case RegOps.APUT: {
Type source = sources.getType(1);
if (source == Type.KNOWN_NULL) {
// Treat a known-null as an Object[] in this context.
source = Type.OBJECT_ARRAY;
}
return opAput(source.getComponentType());
}
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 Rop | throwBadType(com.android.dx.rop.type.TypeBearer type)Throws the right exception to complain about a bogus type.
throw new IllegalArgumentException("bad type: " + type);
|
private static Rop | throwBadTypes(com.android.dx.rop.type.TypeList types)Throws the right exception to complain about a bogus list of types.
throw new IllegalArgumentException("bad types: " + types);
|