com.android.dx.rop.code.BasicBlockList.labelToBlock()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中com.android.dx.rop.code.BasicBlockList.labelToBlock()方法的一些代码示例,展示了BasicBlockList.labelToBlock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BasicBlockList.labelToBlock()方法的具体详情如下:
包路径:com.android.dx.rop.code.BasicBlockList
类名称:BasicBlockList
方法名:labelToBlock

BasicBlockList.labelToBlock介绍

[英]Gets the first block in the list with the given label, if any.
[中]获取列表中具有给定标签的第一个块(如果有)。

代码示例

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: com.google.android.tools/dx

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: com.android/dx

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/**
 * Performs initial creation of output instructions based on the
 * original blocks.
 */
private void outputInstructions() {
  BasicBlockList blocks = method.getBlocks();
  int[] order = this.order;
  int len = order.length;
  // Process the blocks in output order.
  for (int i = 0; i < len; i++) {
    int nextI = i + 1;
    int nextLabel = (nextI == order.length) ? -1 : order[nextI];
    outputBlock(blocks.labelToBlock(order[i]), nextLabel);
  }
}

代码示例来源:origin: com.google.android.tools/dx

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/**
 * Combines blocks proven identical into one alpha block, re-writing
 * all of the successor links that point to the beta blocks to point
 * to the alpha block instead.
 *
 * @param alphaLabel block that will replace all the beta block
 * @param betaLabels label list of blocks to combine
 */
private void combineBlocks(int alphaLabel, IntList betaLabels) {
  int szBetas = betaLabels.size();
  for (int i = 0; i < szBetas; i++) {
    int betaLabel = betaLabels.get(i);
    BasicBlock bb = blocks.labelToBlock(betaLabel);
    IntList preds = ropMethod.labelToPredecessors(bb.getLabel());
    int szPreds = preds.size();
    for (int j = 0; j < szPreds; j++) {
      BasicBlock predBlock = newBlocks.labelToBlock(preds.get(j));
      replaceSucc(predBlock, betaLabel, alphaLabel);
    }
  }
}

代码示例来源:origin: nikita36078/J2ME-Loader

/**
 * Looks forward to the current block's primary successor, returning
 * the RegisterSpec of the result of the move-result-pseudo at the
 * top of that block or null if none.
 *
 * @return {@code null-ok;} result of move-result-pseudo at the beginning of
 * primary successor
 */
private RegisterSpec getNextMoveResultPseudo()
{
  int label = block.getPrimarySuccessor();
  if (label < 0) {
    return null;
  }
  Insn insn
      = method.getBlocks().labelToBlock(label).getInsns().get(0);
  if (insn.getOpcode().getOpcode() != RegOps.MOVE_RESULT_PSEUDO) {
    return null;
  } else {
    return insn.getResult();
  }
}

代码示例来源:origin: com.android.tools.build/builder

/**
 * Looks forward to the current block's primary successor, returning
 * the RegisterSpec of the result of the move-result-pseudo at the
 * top of that block or null if none.
 *
 * @return {@code null-ok;} result of move-result-pseudo at the beginning of
 * primary successor
 */
private RegisterSpec getNextMoveResultPseudo()
{
  int label = block.getPrimarySuccessor();
  if (label < 0) {
    return null;
  }
  Insn insn
      = method.getBlocks().labelToBlock(label).getInsns().get(0);
  if (insn.getOpcode().getOpcode() != RegOps.MOVE_RESULT_PSEUDO) {
    return null;
  } else {
    return insn.getResult();
  }
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/**
 * Looks forward to the current block's primary successor, returning
 * the RegisterSpec of the result of the move-result-pseudo at the
 * top of that block or null if none.
 *
 * @return {@code null-ok;} result of move-result-pseudo at the beginning of
 * primary successor
 */
private RegisterSpec getNextMoveResultPseudo()
{
  int label = block.getPrimarySuccessor();
  if (label < 0) {
    return null;
  }
  Insn insn
      = method.getBlocks().labelToBlock(label).getInsns().get(0);
  if (insn.getOpcode().getOpcode() != RegOps.MOVE_RESULT_PSEUDO) {
    return null;
  } else {
    return insn.getResult();
  }
}

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Looks forward to the current block's primary successor, returning
 * the RegisterSpec of the result of the move-result-pseudo at the
 * top of that block or null if none.
 *
 * @return {@code null-ok;} result of move-result-pseudo at the beginning of
 * primary successor
 */
private RegisterSpec getNextMoveResultPseudo()
{
  int label = block.getPrimarySuccessor();
  if (label < 0) {
    return null;
  }
  Insn insn
      = method.getBlocks().labelToBlock(label).getInsns().get(0);
  if (insn.getOpcode().getOpcode() != RegOps.MOVE_RESULT_PSEUDO) {
    return null;
  } else {
    return insn.getResult();
  }
}

代码示例来源:origin: com.android/dx

/**
 * Looks forward to the current block's primary successor, returning
 * the RegisterSpec of the result of the move-result-pseudo at the
 * top of that block or null if none.
 *
 * @return {@code null-ok;} result of move-result-pseudo at the beginning of
 * primary successor
 */
private RegisterSpec getNextMoveResultPseudo()
{
  int label = block.getPrimarySuccessor();
  if (label < 0) {
    return null;
  }
  Insn insn
      = method.getBlocks().labelToBlock(label).getInsns().get(0);
  if (insn.getOpcode().getOpcode() != RegOps.MOVE_RESULT_PSEUDO) {
    return null;
  } else {
    return insn.getResult();
  }
}

相关文章