public IfNode(DecodedInstruction insn, IfOp op) { this(op, insn.getTarget(), InsnArg.reg(insn, 0, ARG_TYPE), insn.getRegisterCount() == 1 ? InsnArg.lit(0, ARG_TYPE) : InsnArg.reg(insn, 1, ARG_TYPE)); }
public ArithNode(DecodedInstruction insn, ArithOp op, ArgType type, boolean literal) { super(InsnType.ARITH, 2); this.op = op; setResult(InsnArg.reg(insn, 0, type)); int rc = insn.getRegisterCount(); if (literal) { if (rc == 1) { // self addReg(insn, 0, type); addLit(insn, type); } else if (rc == 2) { // normal addReg(insn, 1, type); addLit(insn, type); } } else { if (rc == 2) { // self addReg(insn, 0, type); addReg(insn, 1, type); } else if (rc == 3) { // normal addReg(insn, 1, type); addReg(insn, 2, type); } } }
private InsnNode filledNewArray(DecodedInstruction insn, int offset, boolean isRange) { int resReg = getMoveResultRegister(insnArr, offset); ArgType arrType = dex.getType(insn.getIndex()); ArgType elType = arrType.getArrayElement(); boolean typeImmutable = elType.isPrimitive(); int regsCount = insn.getRegisterCount(); InsnArg[] regs = new InsnArg[regsCount]; if (isRange) { int r = insn.getA(); for (int i = 0; i < regsCount; i++) { regs[i] = InsnArg.reg(r, elType, typeImmutable); r++; } } else { for (int i = 0; i < regsCount; i++) { int regNum = InsnUtils.getArg(insn, i); regs[i] = InsnArg.reg(regNum, elType, typeImmutable); } } InsnNode node = new FilledNewArrayNode(elType, regs.length); node.setResult(resReg == -1 ? null : InsnArg.reg(resReg, arrType)); for (InsnArg arg : regs) { node.addArg(arg); } return node; }
/** * Gets the register count, as a code unit. This will throw if the * value is out of the range of an unsigned code unit. */ public final short getRegisterCountUnit() { int registerCount = getRegisterCount(); if ((registerCount & ~0xffff) != 0) { throw new DexException("Register count out of range: " + Hex.u8(registerCount)); } return (short) registerCount; }
/** * Gets the register count, as a code unit. This will throw if the * value is out of the range of an unsigned code unit. */ public final short getRegisterCountUnit() { int registerCount = getRegisterCount(); if ((registerCount & ~0xffff) != 0) { throw new DexException("Register count out of range: " + Hex.u8(registerCount)); } return (short) registerCount; }
/** * Gets the register count, as a code unit. This will throw if the * value is out of the range of an unsigned code unit. */ public final short getRegisterCountUnit() { int registerCount = getRegisterCount(); if ((registerCount & ~0xffff) != 0) { throw new DexException("Register count out of range: " + Hex.u8(registerCount)); } return (short) registerCount; }
/** * Gets the register count, as a code unit. This will throw if the * value is out of the range of an unsigned code unit. */ public final short getRegisterCountUnit() { int registerCount = getRegisterCount(); if ((registerCount & ~0xffff) != 0) { throw new DexException("Register count out of range: " + Hex.u8(registerCount)); } return (short) registerCount; }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getCUnit(), insn.getProtoIndex()); } },
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
/** * Helper method that encodes any of the three-unit register-range formats. */ private static void encodeRegisterRange(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), insn.getRegisterCount()), insn.getIndexUnit(), insn.getAUnit()); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }