Package jadx.core.dex.attributes.nodes

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


        // 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

      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

          }
          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

TOP

Related Classes of jadx.core.dex.attributes.nodes.LoopInfo

Copyright © 2018 www.massapicom. 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.