Examples of TernaryInsn


Examples of jadx.core.dex.instructions.mods.TernaryInsn

        resArg = phi.getResult();
      } else {
        resArg = t.getResult();
        phi.removeArg(e.getResult());
      }
      TernaryInsn ternInsn = new TernaryInsn(ifRegion.getCondition(),
          resArg, InsnArg.wrapArg(t), InsnArg.wrapArg(e));
      ternInsn.setSourceLine(t.getSourceLine());

      // remove 'if' instruction
      header.getInstructions().clear();
      header.getInstructions().add(ternInsn);

      // shrink method again
      CodeShrinker.shrinkMethod(mth);
      return true;
    }

    if (!mth.getReturnType().equals(ArgType.VOID)
        && t.getType() == InsnType.RETURN && e.getType() == InsnType.RETURN) {

      if (!ifRegion.getParent().replaceSubBlock(ifRegion, header)) {
        return false;
      }
      InsnList.remove(tb, t);
      InsnList.remove(eb, e);
      tb.remove(AFlag.RETURN);
      eb.remove(AFlag.RETURN);

      TernaryInsn ternInsn = new TernaryInsn(ifRegion.getCondition(), null, t.getArg(0), e.getArg(0));
      ternInsn.setSourceLine(t.getSourceLine());
      InsnNode retInsn = new InsnNode(InsnType.RETURN, 1);
      retInsn.addArg(InsnArg.wrapArg(ternInsn));

      header.getInstructions().clear();
      header.getInstructions().add(retInsn);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.