Package cfg

Examples of cfg.BasicBlock


    //
    for (int w = 0; w < size; w++) {
      header[w] = 0;
      type[w] = BasicBlockClass.BB_NONHEADER;

      BasicBlock nodeW = nodes[w].getBb();
      if (nodeW == null) {
        type[w] = BasicBlockClass.BB_DEAD;
        continue// dead BB
      }

      if (nodeW.getNumPred() > 0) {
        for (BasicBlock nodeV : nodeW.getInEdges()) {
          int v = number.get(nodeV);
          if (v == UNVISITED) {
            continue// dead node
          }

          if (isAncestor(w, v, last)) {
            backPreds.get(w).add(v);
          } else {
            nonBackPreds.get(w).add(v);
          }
        }
      }
    }

    // Start node is root of all other loops.
    header[0] = 0;

    // Step c:
    //
    // The outer loop, unchanged from Tarjan. It does nothing except
    // for those nodes which are the destinations of backedges.
    // For a header node w, we chase backward from the sources of the
    // backedges adding nodes to the set P, representing the body of
    // the loop headed by w.
    //
    // By running through the nodes in reverse of the DFST preorder,
    // we ensure that inner loop headers will be processed before the
    // headers for surrounding loops.
    //
    for (int w = size - 1; w >= 0; w--) {
      // this is 'P' in Havlak's paper
      LinkedList<UnionFindNode> nodePool = new LinkedList<UnionFindNode>();

      BasicBlock  nodeW = nodes[w].getBb();
      if (nodeW == null) {
        continue// dead BB
      }

      // Step d:
View Full Code Here


    int lastid = current;
    // for (BasicBlock target : currentNode.getOutEdges()) {
    int len = currentNode.getOutEdges().size();
    for (int i = 0; i < len; i++) {
      BasicBlock target = currentNode.getOutEdges().get(i);
      if (number.get(target) == UNVISITED) {
        lastid = doDFS(target, nodes, number, last, lastid + 1);
      }
    }
    last[number.get(currentNode)] = lastid;
View Full Code Here

    //
    for (int w = 0; w < size; w++) {
      header[w] = 0;
      type[w] = BasicBlockClass.BB_NONHEADER;

      BasicBlock nodeW = nodes[w].getBb();
      if (nodeW == null) {
        type[w] = BasicBlockClass.BB_DEAD;
        continue// dead BB
      }

      if (nodeW.getNumPred() > 0) {
        int len1 = nodeW.getInEdges().size();
        for (int i = 0; i < len1; i++) {
          // for (BasicBlock nodeV : nodeW.getInEdges()) {
          BasicBlock nodeV = nodeW.getInEdges().get(i);
          int v = number.get(nodeV);
          if (v == UNVISITED) {
            continue// dead node
          }

          if (isAncestor(w, v, last)) {
            backPreds.get(w).add(v);
          } else {
            nonBackPreds.get(w).add(v);
          }
        }
      }
    }

    // Start node is root of all other loops.
    header[0] = 0;

    // Step c:
    //
    // The outer loop, unchanged from Tarjan. It does nothing except
    // for those nodes which are the destinations of backedges.
    // For a header node w, we chase backward from the sources of the
    // backedges adding nodes to the set P, representing the body of
    // the loop headed by w.
    //
    // By running through the nodes in reverse of the DFST preorder,
    // we ensure that inner loop headers will be processed before the
    // headers for surrounding loops.
    //
    for (int w = size - 1; w >= 0; w--) {
      // this is 'P' in Havlak's paper
      LinkedList<UnionFindNode> nodePool = new LinkedList<UnionFindNode>();

      BasicBlock  nodeW = nodes[w].getBb();
      if (nodeW == null) {
        continue// dead BB
      }

      // Step d:
View Full Code Here

TOP

Related Classes of cfg.BasicBlock

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.