@Override
public DecodedInstruction decode(int opcodeUnit,
CodeInput in) throws EOFException {
int opcode = byte0(opcodeUnit);
if (opcode != Opcodes.INVOKE_POLYMORPHIC) {
throw new UnsupportedOperationException(String.valueOf(opcode));
}
int g = nibble2(opcodeUnit);
int registerCount = nibble3(opcodeUnit);
int methodIndex = in.read();
int cdef = in.read();
int c = nibble0(cdef);
int d = nibble1(cdef);
int e = nibble2(cdef);
int f = nibble3(cdef);
int protoIndex = in.read();
IndexType indexType = OpcodeInfo.getIndexType(opcode);
if (registerCount < 1 || registerCount > 5) {
throw new DexException("bogus registerCount: " + Hex.uNibble(registerCount));
}
int[] registers = {c, d, e, f, g};
registers = Arrays.copyOfRange(registers, 0, registerCount);
return new InvokePolymorphicDecodedInstruction(
this, opcode, methodIndex, indexType, protoIndex, registers);
}