Package jadx.core.dex.nodes

Examples of jadx.core.dex.nodes.BlockNode


  private static boolean argInLoop(MethodNode mth, LoopRegion loopRegion, RegisterArg arg) {
    InsnNode parentInsn = arg.getParentInsn();
    if (parentInsn == null) {
      return false;
    }
    BlockNode block = BlockUtils.getBlockByInsn(mth, parentInsn);
    if (block == null) {
      LOG.debug(" LoopRegionVisitor: instruction not found: {}, mth: {}", parentInsn, mth);
      return false;
    }
    return RegionUtils.isRegionContainsBlock(loopRegion, block);
View Full Code Here


      }
    }
  }

  public static void remove(MethodNode mth, InsnNode insn) {
    BlockNode block = BlockUtils.getBlockByInsn(mth, insn);
    if (block != null) {
      remove(mth, block, insn);
    }
  }
View Full Code Here

      list = cleanBlockList(list);
    }
    if (list.size() != 2) {
      throw new JadxRuntimeException("Incorrect nodes count for selectOther: " + node + " in " + list);
    }
    BlockNode first = list.get(0);
    if (first != node) {
      return first;
    } else {
      return list.get(1);
    }
View Full Code Here

  }

  public static BlockNode selectOtherSafe(BlockNode node, List<BlockNode> blocks) {
    int size = blocks.size();
    if (size == 1) {
      BlockNode first = blocks.get(0);
      return first != node ? first : null;
    } else if (size == 2) {
      BlockNode first = blocks.get(0);
      return first != node ? first : blocks.get(1);
    }
    return null;
  }
View Full Code Here

  /**
   * Remove exception handlers from block nodes bitset
   */
  public static void cleanBitSet(MethodNode mth, BitSet bs) {
    for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
      BlockNode block = mth.getBasicBlocks().get(i);
      if (block.contains(AType.EXC_HANDLER)) {
        bs.clear(i);
      }
    }
  }
View Full Code Here

  }

  public static List<BlockNode> bitSetToBlocks(MethodNode mth, BitSet bs) {
    List<BlockNode> blocks = new ArrayList<BlockNode>(bs.cardinality());
    for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
      BlockNode block = mth.getBasicBlocks().get(i);
      blocks.add(block);
    }
    return blocks;
  }
View Full Code Here

  public static BlockNode traverseWhileDominates(BlockNode dom, BlockNode start) {
    for (BlockNode node : start.getCleanSuccessors()) {
      if (!node.isDominator(dom)) {
        return node;
      } else {
        BlockNode out = traverseWhileDominates(dom, node);
        if (out != null) {
          return out;
        }
      }
    }
View Full Code Here

    b.or(b1.getDomFrontier());
    b.and(b2.getDomFrontier());
    b.clear(b1.getId());
    b.clear(b2.getId());
    if (b.cardinality() == 1) {
      BlockNode end = mth.getBasicBlocks().get(b.nextSetBit(0));
      if (isPathExists(b1, end) && isPathExists(b2, end)) {
        return end;
      }
    }
    if (isPathExists(b1, b2)) {
View Full Code Here

      return true;
    }
    if (!start.getInstructions().isEmpty() || start.getCleanSuccessors().size() != 1) {
      return false;
    }
    BlockNode block = getNextBlock(start);
    while (block != null
        && block != end
        && block.getCleanSuccessors().size() < 2
        && block.getPredecessors().size() == 1
        && block.getInstructions().isEmpty()) {
      block = getNextBlock(block);
    }
    return block == end;
  }
View Full Code Here

      for (int id = assignBlocks.nextSetBit(0); id >= 0; id = assignBlocks.nextSetBit(id + 1)) {
        processed.set(id);
        workList.add(blocks.get(id));
      }
      while (!workList.isEmpty()) {
        BlockNode block = workList.pop();
        BitSet domFrontier = block.getDomFrontier();
        for (int id = domFrontier.nextSetBit(0); id >= 0; id = domFrontier.nextSetBit(id + 1)) {
          if (!hasPhi.get(id) && la.isLive(id, regNum)) {
            BlockNode df = blocks.get(id);
            addPhi(df, regNum);
            hasPhi.set(id);
            if (!processed.get(id)) {
              processed.set(id);
              workList.add(df);
View Full Code Here

TOP

Related Classes of jadx.core.dex.nodes.BlockNode

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.