当前位置: 首页>>代码示例>>Java>>正文


Java DexOptions.ALIGN_64BIT_REGS_SUPPORT属性代码示例

本文整理汇总了Java中com.android.dx.dex.DexOptions.ALIGN_64BIT_REGS_SUPPORT属性的典型用法代码示例。如果您正苦于以下问题:Java DexOptions.ALIGN_64BIT_REGS_SUPPORT属性的具体用法?Java DexOptions.ALIGN_64BIT_REGS_SUPPORT怎么用?Java DexOptions.ALIGN_64BIT_REGS_SUPPORT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.android.dx.dex.DexOptions的用法示例。


在下文中一共展示了DexOptions.ALIGN_64BIT_REGS_SUPPORT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAlignment

/**
 * Return the register alignment constraint to have 64-bits registers that will be align on even
 * dalvik registers after that parameter registers are move up to the top of the frame to match
 * the calling convention.
 *
 * @param regCategory category of the register that will be aligned.
 * @return the register alignment constraint.
 */
private Alignment getAlignment(int regCategory) {
  Alignment alignment = Alignment.UNSPECIFIED;

  if (DexOptions.ALIGN_64BIT_REGS_SUPPORT && regCategory == 2) {
    if (isEven(paramRangeEnd)) {
      alignment = Alignment.EVEN;
    } else {
      alignment = Alignment.ODD;
    }
  }

  return alignment;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:21,代码来源:FirstFitLocalCombiningAllocator.java

示例2: findAnyFittingRange

/**
 * Finds an unreserved range that will fit the sources of the
 * specified instruction. Does not bother trying to center the range
 * around an already-mapped source register;
 *
 * @param insn {@code non-null;} insn to build range for
 * @param rangeLength {@code >=0;} length required in register units
 * @param categoriesForIndex {@code non-null;} indexed by source index;
 * the category for each source
 * @param outMovesRequired {@code non-null;} an output parameter indexed by
 * source index that will contain the set of sources which need
 * moves inserted
 * @return the rop register that starts the fitting range
 */
private int findAnyFittingRange(NormalSsaInsn insn, int rangeLength,
        int[] categoriesForIndex, BitSet outMovesRequired) {
    Alignment alignment = Alignment.UNSPECIFIED;

    if (DexOptions.ALIGN_64BIT_REGS_SUPPORT) {
      int regNumber = 0;
      int p64bitsAligned = 0;
      int p64bitsNotAligned = 0;
      for (int category : categoriesForIndex) {
        if (category == 2) {
          if (isEven(regNumber)) {
            p64bitsAligned++;
          } else {
            p64bitsNotAligned++;
          }
          regNumber += 2;
        } else {
          regNumber += 1;
        }
      }

      if (p64bitsNotAligned > p64bitsAligned) {
        if (isEven(paramRangeEnd)) {
          alignment = Alignment.ODD;
        } else {
          alignment = Alignment.EVEN;
        }
      } else if (p64bitsAligned > 0) {
        if (isEven(paramRangeEnd)) {
          alignment = Alignment.EVEN;
        } else {
          alignment = Alignment.ODD;
        }
      }
    }

    int rangeStart = paramRangeEnd;
    while (true) {
      rangeStart = findNextUnreservedRopReg(rangeStart, rangeLength, alignment);

      int fitWidth = fitPlanForRange(rangeStart, insn, categoriesForIndex, outMovesRequired);

      if (fitWidth >= 0) {
        break;
      }
      rangeStart++;
      outMovesRequired.clear();
    }

    return rangeStart;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:65,代码来源:FirstFitLocalCombiningAllocator.java


注:本文中的com.android.dx.dex.DexOptions.ALIGN_64BIT_REGS_SUPPORT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。