Examples of BasicBlock


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

Examples of cfg.BasicBlock

    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

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) {
        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

Examples of com.ackgaming.entity.blocks.BasicBlock

          b.draw();
      }
     
      for(int i=0; i<blocks.size(); i++) {
        if(blocks.get(i) instanceof BasicBlock) {
          BasicBlock b = (BasicBlock) blocks.get(i);
            b.draw();
        } else if(blocks.get(i) instanceof SecondBlock) {
          SecondBlock b = (SecondBlock) blocks.get(i);
          b.draw();
        } else if(blocks.get(i) instanceof ThirdBlock) {
          ThirdBlock b = (ThirdBlock) blocks.get(i);
        b.draw();
        } else if(blocks.get(i) instanceof BonusLifeBlock) {
          BonusLifeBlock b = (BonusLifeBlock) blocks.get(i);
        b.draw();
        }
      }
    }
View Full Code Here

Examples of com.ackgaming.entity.blocks.BasicBlock

     
      //Check intersection with ball and blocks
      for(int i=0; i<blocks.size(); i++) {
       
        if(blocks.get(i) instanceof BasicBlock) {
            BasicBlock b = (BasicBlock) blocks.get(i);
           
            if(checkBoxPos(b)) {
              score += 10;
                  blocks.remove(i);
                  b.setDestroyed();
                  b.setVisible(false);
          }
        } else if(blocks.get(i) instanceof SecondBlock){
          SecondBlock b = (SecondBlock) blocks.get(i);
         
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  b.setImage(basicBlockImg);
                  if(b.timesHit == 2) {
                    score += 15;
                    blocks.remove(i);
                    b.setDestroyed();
                    b.setVisible(false);
                  } else score += 5;
          }
        } else if(blocks.get(i) instanceof ThirdBlock) {
          ThirdBlock b = (ThirdBlock) blocks.get(i);
         
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  if(b.timesHit == 1){
                    b.setImage(secondBlockImg);
                    score += 5;
                  } else if(b.timesHit == 2) {
                    b.setImage(basicBlockImg);
                    score += 5;
                  } else if(b.timesHit == 3) {
                    score += 20;
                    b.setDestroyed();
                    b.setVisible(false);
                    blocks.remove(i);
                  }
          }
        } else if(blocks.get(i) instanceof BonusLifeBlock) {
          BonusLifeBlock b = (BonusLifeBlock) blocks.get(i);
          int blockX = (int) b.getRect().getMinX();
          int blockY = (int) b.getRect().getMaxY();
          if(checkBoxPos(b)) {
                  b.timesHit++;
                  b.setImage(bonusLifeBlockDamImg);
                  if(b.timesHit == 2) {
                    //lives++;
                    blocks.remove(i);
                    b.setDestroyed();
                    b.setVisible(false);
                    drops.add(new BonusLifeItem(bonusLifeItemImg, blockX, blockY));
                  } else score += 10;
          }
        }
      }
View Full Code Here

Examples of com.android.dx.rop.code.BasicBlock

        if (alternateSuccessor != null) {
            successors.add(alternateSuccessor.id);
        }
        successors.setImmutable();

        return new BasicBlock(id, result, successors, primarySuccessorIndex);
    }
View Full Code Here

Examples of com.android.dx.rop.code.BasicBlock

        int maxLabel = blocks.getMaxLabel();
        int[] workSet = Bits.makeBitSet(maxLabel);
        int[] tracebackSet = Bits.makeBitSet(maxLabel);

        for (int i = 0; i < sz; i++) {
            BasicBlock one = blocks.get(i);
            Bits.set(workSet, one.getLabel());
        }

        int[] order = new int[sz];
        int at = 0;

        /*
         * Starting with the designated "first label" (that is, the
         * first block of the method), add that label to the order,
         * and then pick its first as-yet unordered successor to
         * immediately follow it, giving top priority to the primary
         * (aka default) successor (if any). Keep following successors
         * until the trace runs out of possibilities. Then, continue
         * by finding an unordered chain containing the first as-yet
         * unordered block, and adding it to the order, and so on.
         */
        for (int label = method.getFirstLabel();
             label != -1;
             label = Bits.findFirst(workSet, 0)) {

            /*
             * Attempt to trace backward from the chosen block to an
             * as-yet unordered predecessor which lists the chosen
             * block as its primary successor, and so on, until we
             * fail to find such an unordered predecessor. Start the
             * trace with that block. Note that the first block in the
             * method has no predecessors, so in that case this loop
             * will simply terminate with zero iterations and without
             * picking a new starter block.
             */
            traceBack:
            for (;;) {
                IntList preds = method.labelToPredecessors(label);
                int psz = preds.size();

                for (int i = 0; i < psz; i++) {
                    int predLabel = preds.get(i);

                    if (Bits.get(tracebackSet, predLabel)) {
                        /*
                         * We found a predecessor loop; stop tracing back
                         * from here.
                         */
                        break;
                    }

                    if (!Bits.get(workSet, predLabel)) {
                        // This one's already ordered.
                        continue;
                    }

                    BasicBlock pred = blocks.labelToBlock(predLabel);
                    if (pred.getPrimarySuccessor() == label) {
                        // Found one!
                        label = predLabel;
                        Bits.set(tracebackSet, label);
                        continue traceBack;
                    }
                }

                // Failed to find a better block to start the trace.
                break;
            }

            /*
             * Trace a path from the chosen block to one of its
             * unordered successors (hopefully the primary), and so
             * on, until we run out of unordered successors.
             */
            while (label != -1) {
                Bits.clear(workSet, label);
                Bits.clear(tracebackSet, label);
                order[at] = label;
                at++;

                BasicBlock one = blocks.labelToBlock(label);
                BasicBlock preferredBlock = blocks.preferredSuccessorOf(one);

                if (preferredBlock == null) {
                    break;
                }

                int preferred = preferredBlock.getLabel();
                int primary = one.getPrimarySuccessor();

                if (Bits.get(workSet, preferred)) {
                    /*
                     * Order the current block's preferred successor
View Full Code Here

Examples of com.google.havlak.shared.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

Examples of com.google.javascript.jscomp.ReferenceCollectingCallback.BasicBlock

      for (Reference reference : references) {
        if (reference == hoistedFn) {
          continue;
        }
        BasicBlock basicBlock = reference.getBasicBlock();
        boolean isDeclaration = reference.isDeclaration();
        Node referenceNode = reference.getNode();

        boolean allowDupe =
            VarCheck.hasDuplicateDeclarationSuppression(
View Full Code Here

Examples of com.google.javascript.jscomp.ReferenceCollectingCallback.BasicBlock

      for (Reference reference : references) {
        if (reference == hoistedFn) {
          continue;
        }

        BasicBlock basicBlock = reference.getBasicBlock();
        boolean isDeclaration = reference.isDeclaration();

        boolean allowDupe =
            SyntacticScopeCreator.hasDuplicateDeclarationSuppression(
                reference.getNode(), v);
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.