/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuilder sb = new StringBuilder(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
/** * Helper method to return a literal bits comment string. * * @param value the value * @param width the width of the constant, in bits (used for displaying * the uninterpreted bits; one of: {@code 4 8 16 32 64} * @return {@code non-null;} the comment */ protected static String literalBitsComment(CstLiteralBits value, int width) { StringBuffer sb = new StringBuffer(20); sb.append("#"); long bits; if (value instanceof CstLiteral64) { bits = ((CstLiteral64) value).getLongBits(); } else { bits = value.getIntBits(); } switch (width) { case 4: sb.append(Hex.uNibble((int) bits)); break; case 8: sb.append(Hex.u1((int) bits)); break; case 16: sb.append(Hex.u2((int) bits)); break; case 32: sb.append(Hex.u4((int) bits)); break; case 64: sb.append(Hex.u8(bits)); break; default: { throw new RuntimeException("shouldn't happen"); } } return sb.toString(); }
@Override public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException { int opcode = byte0(opcodeUnit); if (opcode != Opcodes.INVOKE_POLYMORPHIC) { // 45cc isn't currently used for anything other than invoke-polymorphic. // If that changes, add a more general DecodedInstruction for this format. 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); }
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));
+ Hex.uNibble(registerCount));