Examples of LoopInfo


Examples of jadx.core.dex.attributes.nodes.LoopInfo

    List<LoopInfo> inLoops = mth.getAllLoopsForBlock(exitEdge.getSource());
    if (inLoops.size() < 2) {
      return;
    }
    // search for parent loop
    LoopInfo parentLoop = null;
    for (LoopInfo loop : inLoops) {
      if (loop.getParentLoop() == null) {
        parentLoop = loop;
        break;
      }
    }
    if (parentLoop == null) {
      return;
    }
    if (parentLoop.getEnd() != exit && !parentLoop.getExitNodes().contains(exit)) {
      LoopLabelAttr labelAttr = new LoopLabelAttr(parentLoop);
      breakInsn.addAttr(labelAttr);
      parentLoop.getStart().addAttr(labelAttr);
    }
  }
View Full Code Here

Examples of jadx.core.dex.attributes.nodes.LoopInfo

        // block -> succ is a back edge.
        if (block.getDoms().get(succ.getId())) {
          succ.add(AFlag.LOOP_START);
          block.add(AFlag.LOOP_END);

          LoopInfo loop = new LoopInfo(succ, block);
          succ.addAttr(AType.LOOP, loop);
          block.addAttr(AType.LOOP, loop);
        }
      }
    }
View Full Code Here

Examples of jadx.core.dex.attributes.nodes.LoopInfo

      for (LoopInfo innerLoop : mth.getLoops()) {
        if (outLoop == innerLoop) {
          continue;
        }
        if (outLoop.getLoopBlocks().containsAll(innerLoop.getLoopBlocks())) {
          LoopInfo parentLoop = innerLoop.getParentLoop();
          if (parentLoop != null) {
            if (parentLoop.getLoopBlocks().containsAll(outLoop.getLoopBlocks())) {
              outLoop.setParentLoop(parentLoop);
              innerLoop.setParentLoop(outLoop);
            } else {
              parentLoop.setParentLoop(outLoop);
            }
          } else {
            innerLoop.setParentLoop(outLoop);
          }
        }
View Full Code Here

Examples of jadx.core.dex.attributes.nodes.LoopInfo

          }
          return true;
        }
      }
      if (loops.size() == 1) {
        LoopInfo loop = loops.get(0);
        // insert additional blocks for possible 'break' insertion
        List<Edge> edges = loop.getExitEdges();
        if (!edges.isEmpty()) {
          boolean change = false;
          for (Edge edge : edges) {
            BlockNode target = edge.getTarget();
            if (!target.contains(AFlag.SYNTHETIC)) {
              insertBlockBetween(mth, edge.getSource(), target);
              change = true;
            }
          }
          if (change) {
            return true;
          }
        }
        // insert additional blocks for possible 'continue' insertion
        BlockNode loopEnd = loop.getEnd();
        if (loopEnd.getPredecessors().size() > 1) {
          boolean change = false;
          List<BlockNode> nodes = new ArrayList<BlockNode>(loopEnd.getPredecessors());
          for (BlockNode pred : nodes) {
            if (!pred.contains(AFlag.SYNTHETIC)) {
View Full Code Here

Examples of webit.script.core.LoopInfo

        int varIndexer = varmgr.pop();
        boolean hasReturnLoops = false;
        List<LoopInfo> loopInfos = StatementUtil.collectPossibleLoopsInfo(statements);
        if (loopInfos != null) {
            for (Iterator<LoopInfo> it = loopInfos.iterator(); it.hasNext();) {
                LoopInfo loopInfo = it.next();
                if (loopInfo.type == LoopInfo.RETURN) {
                    hasReturnLoops = true;
                    it.remove();
                }
            }
View Full Code Here

Examples of webit.script.core.LoopInfo

    }

    public static LoopInfo[] collectPossibleLoopsInfoForWhile(Statement bodyStatement, Statement elseStatement, int label) {

        List<LoopInfo> list;
        LoopInfo loopInfo;
        if ((list = StatementUtil.collectPossibleLoopsInfo(bodyStatement)) != null) {
            for (Iterator<LoopInfo> it = list.iterator(); it.hasNext();) {
                loopInfo = it.next();
                if (loopInfo.matchLabel(label)
                        && (loopInfo.type == LoopInfo.BREAK
                        || loopInfo.type == LoopInfo.CONTINUE)) {
                    it.remove();
                }
            }
View Full Code Here

Examples of webit.script.core.LoopInfo

        return null;
    }

    public List<LoopInfo> collectPossibleLoopsInfo() {
        LinkedList<LoopInfo> list;
        (list = new LinkedList<LoopInfo>()).add(new LoopInfo(LoopInfo.CONTINUE, label, line, column));
        return list;
    }
View Full Code Here

Examples of webit.script.core.LoopInfo

        return null;
    }

    public List<LoopInfo> collectPossibleLoopsInfo() {
        LinkedList<LoopInfo> list;
        (list = new LinkedList<LoopInfo>()).add(new LoopInfo(LoopInfo.RETURN, 0, line, column));
        return list;
    }
View Full Code Here

Examples of webit.script.core.LoopInfo

        return null;
    }

    public List<LoopInfo> collectPossibleLoopsInfo() {
        LinkedList<LoopInfo> list;
        (list = new LinkedList<LoopInfo>()).add(new LoopInfo(LoopInfo.BREAK, label, line, column));
        return list;
    }
View Full Code Here

Examples of webit.script.core.LoopInfo

                loopInfos.addAll(list);
            }
        }

        //remove loops for this switch
        LoopInfo loopInfo;
        for (Iterator<LoopInfo> it = loopInfos.iterator(); it.hasNext();) {
            if ((loopInfo = it.next()).matchLabel(this.label)
                    && loopInfo.type == LoopInfo.BREAK) {
                it.remove();
            }
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.