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

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

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

BasicBlock.getInsns介绍

[英]Gets the list of instructions inside this block.
[中]获取此块中的指令列表。

代码示例

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 *
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Helper method to compare the contents of two blocks.
 * 
 * @param a {@code non-null;} a block to compare
 * @param b {@code non-null;} another block to compare
 * @return {@code true} iff the two blocks' instructions are the same
 */
private static boolean compareInsns(BasicBlock a, BasicBlock b) {
  return a.getInsns().contentEquals(b.getInsns());
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 *
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Visits each instruction of each block in the list, in order.
 * 
 * @param visitor {@code non-null;} visitor to use
 */
public void forEachInsn(Insn.Visitor visitor) {
  int sz = size();
  for (int i = 0; i < sz; i++) {
    BasicBlock one = get(i);
    InsnList insns = one.getInsns();
    insns.forEach(visitor);
  }
}

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

/**
 * Gets the total instruction count for this instance. This is the
 * sum of the instruction counts of each block.
 *
 * @return {@code >= 0;} the total instruction count
 */
public int getInstructionCount() {
  int sz = size();
  int result = 0;
  for (int i = 0; i < sz; i++) {
    BasicBlock one = (BasicBlock) getOrNull0(i);
    if (one != null) {
      result += one.getInsns().size();
    }
  }
  return result;
}

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

/**
 * Gets the total instruction count for this instance. This is the
 * sum of the instruction counts of each block.
 *
 * @return {@code >= 0;} the total instruction count
 */
public int getInstructionCount() {
  int sz = size();
  int result = 0;
  for (int i = 0; i < sz; i++) {
    BasicBlock one = (BasicBlock) getOrNull0(i);
    if (one != null) {
      result += one.getInsns().size();
    }
  }
  return result;
}

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

/**
   * Sets up the address arrays.
   */
  private void setupArrays(RopMethod method) {
    BasicBlockList blocks = method.getBlocks();
    int sz = blocks.size();

    for (int i = 0; i < sz; i++) {
      BasicBlock one = blocks.get(i);
      int label = one.getLabel();
      Insn insn = one.getInsns().get(0);

      starts[label] = new CodeAddress(insn.getPosition());

      SourcePosition pos = one.getLastInsn().getPosition();

      lasts[label] = new CodeAddress(pos);
      ends[label] = new CodeAddress(pos);
    }
  }
}

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

/**
   * Sets up the address arrays.
   */
  private void setupArrays(RopMethod method) {
    BasicBlockList blocks = method.getBlocks();
    int sz = blocks.size();

    for (int i = 0; i < sz; i++) {
      BasicBlock one = blocks.get(i);
      int label = one.getLabel();
      Insn insn = one.getInsns().get(0);

      starts[label] = new CodeAddress(insn.getPosition());

      SourcePosition pos = one.getLastInsn().getPosition();

      lasts[label] = new CodeAddress(pos);
      ends[label] = new CodeAddress(pos);
    }
  }
}

相关文章