Examples of PhiInsn


Examples of com.android.dx.ssa.PhiInsn

        for (SsaInsn insn : useList) {
            nextFunction = NextFunction.DONE;

            if (insn instanceof PhiInsn) {
                // If s is a phi-function with V as it's ith argument.
                PhiInsn phi = (PhiInsn) insn;

                for (SsaBasicBlock pred :
                         phi.predBlocksForReg(regV, ssaMeth)) {
                    blockN = pred;

                    nextFunction = NextFunction.LIVE_OUT_AT_BLOCK;
                    handleTailRecursion();
                }
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

      var.setName(name);
    }

    // fix type for vars used only in Phi nodes
    for (SSAVar sVar : mth.getSVars()) {
      PhiInsn phi = sVar.getUsedInPhi();
      if (phi != null) {
        processPhiNode(phi);
      }
    }
  }
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

    PhiListAttr phiList = block.get(AType.PHI_LIST);
    if (phiList == null) {
      phiList = new PhiListAttr();
      block.addAttr(phiList);
    }
    PhiInsn phiInsn = new PhiInsn(regNum, block.getPredecessors().size());
    phiList.getList().add(phiInsn);
    phiInsn.setOffset(block.getStartOffset());
    block.getInstructions().add(0, phiInsn);
  }
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

        }
        return true;
      }

      case PHI: {
        PhiInsn phi = (PhiInsn) insn;
        RegisterArg result = phi.getResult();
        SSAVar resultSVar = result.getSVar();
        if (resultSVar != null && !result.getType().isTypeKnown()) {
          for (InsnArg arg : phi.getArguments()) {
            ArgType argType = arg.getType();
            if (argType.isTypeKnown()) {
              resultSVar.setType(argType);
              return true;
            }
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

        }
      }
    }

    if (t.getResult() != null && e.getResult() != null) {
      PhiInsn phi = t.getResult().getSVar().getUsedInPhi();
      if (phi == null || !t.getResult().equalRegisterAndType(e.getResult())) {
        return false;
      }
      if (!ifRegion.getParent().replaceSubBlock(ifRegion, header)) {
        return false;
      }
      InsnList.remove(tb, t);
      InsnList.remove(eb, e);

      RegisterArg resArg;
      if (phi.getArgsCount() == 2) {
        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());
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

   */
  private static boolean checkLineStats(InsnNode t, InsnNode e) {
    if (t.getResult() == null || e.getResult() == null) {
      return false;
    }
    PhiInsn tPhi = t.getResult().getSVar().getUsedInPhi();
    PhiInsn ePhi = e.getResult().getSVar().getUsedInPhi();
    if (tPhi == null || ePhi == null || tPhi != ePhi) {
      return false;
    }
    Map<Integer, Integer> map = new HashMap<Integer, Integer>(tPhi.getArgsCount());
    for (InsnArg arg : tPhi.getArguments()) {
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

    }
    return sVar.getAssign().getParentInsn();
  }

  public InsnNode getPhiAssignInsn() {
    PhiInsn usePhi = sVar.getUsedInPhi();
    if (usePhi != null) {
      return usePhi;
    }
    InsnNode parent = sVar.getAssign().getParentInsn();
    if (parent != null && parent.getType() == InsnType.PHI) {
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

    if (incrArg == null
        || incrArg.getSVar() == null
        || !incrArg.getSVar().isUsedInPhi()) {
      return false;
    }
    PhiInsn phiInsn = incrArg.getSVar().getUsedInPhi();
    if (phiInsn == null
        || phiInsn.getArgsCount() != 2
        || !phiInsn.getArg(1).equals(incrArg)
        || incrArg.getSVar().getUseCount() != 1) {
      return false;
    }
    RegisterArg arg = phiInsn.getResult();
    List<RegisterArg> condArgs = condition.getRegisterArgs();
    if (!condArgs.contains(arg) || arg.getSVar().isUsedInPhi()) {
      return false;
    }
    RegisterArg initArg = phiInsn.getArg(0);
    InsnNode initInsn = initArg.getAssignInsn();
    if (initInsn == null || initArg.getSVar().getUseCount() != 1) {
      return false;
    }
    if (!usedOnlyInLoop(mth, loopRegion, arg)) {
View Full Code Here

Examples of jadx.core.dex.instructions.PhiInsn

    }
    if (!argInLoop(mth, loopRegion, assignInsn.getResult())) {
      return false;
    }
    if (assignInsn instanceof PhiInsn) {
      PhiInsn phiInsn = (PhiInsn) assignInsn;
      for (InsnArg phiArg : phiInsn.getArguments()) {
        if (!assignOnlyInLoop(mth, loopRegion, (RegisterArg) phiArg)) {
          return false;
        }
      }
    }
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.