Methods Summary |
---|
public static com.android.dx.io.instructions.DecodedInstruction | decode(CodeInput in)Decodes an instruction from the given input source.
int opcodeUnit = in.read();
int opcode = Opcodes.extractOpcodeFromUnit(opcodeUnit);
InstructionCodec format = OpcodeInfo.getFormat(opcode);
return format.decode(opcodeUnit, in);
|
public static com.android.dx.io.instructions.DecodedInstruction[] | decodeAll(short[] encodedInstructions)Decodes an array of instructions. The result has non-null
elements at each offset that represents the start of an
instruction.
int size = encodedInstructions.length;
DecodedInstruction[] decoded = new DecodedInstruction[size];
ShortArrayCodeInput in = new ShortArrayCodeInput(encodedInstructions);
try {
while (in.hasMore()) {
decoded[in.cursor()] = DecodedInstruction.decode(in);
}
} catch (EOFException ex) {
throw new DexException(ex);
}
return decoded;
|
public final void | encode(CodeOutput out)Encodes this instance to the given output.
format.encode(this, out);
|
public int | getA()
return 0;
|
public final short | getAByte()Gets the A register number, as a byte. This will throw if the
value is out of the range of an unsigned byte.
int a = getA();
if ((a & ~0xff) != 0) {
throw new DexException("Register A out of range: " + Hex.u8(a));
}
return (short) a;
|
public final short | getANibble()Gets the A register number, as a nibble. This will throw if the
value is out of the range of an unsigned nibble.
int a = getA();
if ((a & ~0xf) != 0) {
throw new DexException("Register A out of range: " + Hex.u8(a));
}
return (short) a;
|
public final short | getAUnit()Gets the A register number, as a code unit. This will throw if the
value is out of the range of an unsigned code unit.
int a = getA();
if ((a & ~0xffff) != 0) {
throw new DexException("Register A out of range: " + Hex.u8(a));
}
return (short) a;
|
public int | getB()
return 0;
|
public final short | getBByte()Gets the B register number, as a byte. This will throw if the
value is out of the range of an unsigned byte.
int b = getB();
if ((b & ~0xff) != 0) {
throw new DexException("Register B out of range: " + Hex.u8(b));
}
return (short) b;
|
public final short | getBNibble()Gets the B register number, as a nibble. This will throw if the
value is out of the range of an unsigned nibble.
int b = getB();
if ((b & ~0xf) != 0) {
throw new DexException("Register B out of range: " + Hex.u8(b));
}
return (short) b;
|
public final short | getBUnit()Gets the B register number, as a code unit. This will throw if the
value is out of the range of an unsigned code unit.
int b = getB();
if ((b & ~0xffff) != 0) {
throw new DexException("Register B out of range: " + Hex.u8(b));
}
return (short) b;
|
public int | getC()
return 0;
|
public final short | getCByte()Gets the C register number, as a byte. This will throw if the
value is out of the range of an unsigned byte.
int c = getC();
if ((c & ~0xff) != 0) {
throw new DexException("Register C out of range: " + Hex.u8(c));
}
return (short) c;
|
public final short | getCNibble()Gets the C register number, as a nibble. This will throw if the
value is out of the range of an unsigned nibble.
int c = getC();
if ((c & ~0xf) != 0) {
throw new DexException("Register C out of range: " + Hex.u8(c));
}
return (short) c;
|
public final short | getCUnit()Gets the C register number, as a code unit. This will throw if the
value is out of the range of an unsigned code unit.
int c = getC();
if ((c & ~0xffff) != 0) {
throw new DexException("Register C out of range: " + Hex.u8(c));
}
return (short) c;
|
public int | getD()
return 0;
|
public final short | getDByte()Gets the D register number, as a byte. This will throw if the
value is out of the range of an unsigned byte.
int d = getD();
if ((d & ~0xff) != 0) {
throw new DexException("Register D out of range: " + Hex.u8(d));
}
return (short) d;
|
public final short | getDNibble()Gets the D register number, as a nibble. This will throw if the
value is out of the range of an unsigned nibble.
int d = getD();
if ((d & ~0xf) != 0) {
throw new DexException("Register D out of range: " + Hex.u8(d));
}
return (short) d;
|
public final short | getDUnit()Gets the D register number, as a code unit. This will throw if the
value is out of the range of an unsigned code unit.
int d = getD();
if ((d & ~0xffff) != 0) {
throw new DexException("Register D out of range: " + Hex.u8(d));
}
return (short) d;
|
public int | getE()
return 0;
|
public final short | getENibble()Gets the E register number, as a nibble. This will throw if the
value is out of the range of an unsigned nibble.
int e = getE();
if ((e & ~0xf) != 0) {
throw new DexException("Register E out of range: " + Hex.u8(e));
}
return (short) e;
|
public final InstructionCodec | getFormat()
return format;
|
public final int | getIndex()
return index;
|
public final com.android.dx.io.IndexType | getIndexType()
return indexType;
|
public final short | getIndexUnit()Gets the index, as a code unit.
return (short) index;
|
public final long | getLiteral()
return literal;
|
public final int | getLiteralByte()Gets the literal value, masked to be a byte in size. This will
throw if the value is out of the range of a signed byte.
if (literal != (byte) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
return (int) literal & 0xff;
|
public final int | getLiteralInt()Gets the literal value, masked to be an int in size. This will
throw if the value is out of the range of a signed int.
if (literal != (int) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
return (int) literal;
|
public final int | getLiteralNibble()Gets the literal value, masked to be a nibble in size. This
will throw if the value is out of the range of a signed nibble.
if ((literal < -8) || (literal > 7)) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
return (int) literal & 0xf;
|
public final short | getLiteralUnit()Gets the literal value, as a code unit. This will throw if the
value is out of the range of a signed code unit.
if (literal != (short) literal) {
throw new DexException("Literal out of range: " + Hex.u8(literal));
}
return (short) literal;
|
public final int | getOpcode()
return opcode;
|
public final short | getOpcodeUnit()Gets the opcode, as a code unit.
return (short) opcode;
|
public abstract int | getRegisterCount()
|
public final short | getRegisterCountUnit()Gets the register count, as a code unit. This will throw if the
value is out of the range of an unsigned code unit.
int registerCount = getRegisterCount();
if ((registerCount & ~0xffff) != 0) {
throw new DexException("Register count out of range: "
+ Hex.u8(registerCount));
}
return (short) registerCount;
|
public final int | getTarget()Gets the raw target.
return target;
|
public final int | getTarget(int baseAddress)Gets the target as a relative offset from the given address.
return target - baseAddress;
|
public final int | getTargetByte(int baseAddress)Gets the target as a relative offset from the given base
address, masked to be a byte in size. This will throw if the
value is out of the range of a signed byte.
int relativeTarget = getTarget(baseAddress);
if (relativeTarget != (byte) relativeTarget) {
throw new DexException("Target out of range: "
+ Hex.s4(relativeTarget));
}
return relativeTarget & 0xff;
|
public final short | getTargetUnit(int baseAddress)Gets the target as a relative offset from the given base
address, as a code unit. This will throw if the value is out of
the range of a signed code unit.
int relativeTarget = getTarget(baseAddress);
if (relativeTarget != (short) relativeTarget) {
throw new DexException("Target out of range: "
+ Hex.s4(relativeTarget));
}
return (short) relativeTarget;
|
public abstract com.android.dx.io.instructions.DecodedInstruction | withIndex(int newIndex)Returns an instance just like this one, except with the index replaced
with the given one.
|