• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SsaToRop类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.android.dx.ssa.back.SsaToRop的典型用法代码示例。如果您正苦于以下问题:Java SsaToRop类的具体用法?Java SsaToRop怎么用?Java SsaToRop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SsaToRop类属于com.android.dx.ssa.back包,在下文中一共展示了SsaToRop类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: optimize

点赞 3

import com.android.dx.ssa.back.SsaToRop; //导入依赖的package包/类
/**
 * Runs optimization algorthims over this method, and returns a new
 * instance of RopMethod with the changes.
 *
 * @param rmeth method to process
 * @param paramWidth the total width, in register-units, of this method's
 * parameters
 * @param isStatic true if this method has no 'this' pointer argument.
 * @param inPreserveLocals true if local variable info should be preserved,
 * at the cost of some registers and insns
 * @param inAdvice {@code non-null;} translation advice
 * @param steps set of optional optimization steps to run
 * @return optimized method
 */
public static RopMethod optimize(RopMethod rmeth, int paramWidth,
        boolean isStatic, boolean inPreserveLocals,
        TranslationAdvice inAdvice, EnumSet<OptionalStep> steps) {
    SsaMethod ssaMeth = null;

    preserveLocals = inPreserveLocals;
    advice = inAdvice;

    ssaMeth = SsaConverter.convertToSsaMethod(rmeth, paramWidth, isStatic);
    runSsaFormSteps(ssaMeth, steps);

    RopMethod resultMeth = SsaToRop.convertToRopMethod(ssaMeth, false);

    if (resultMeth.getBlocks().getRegCount()
            > advice.getMaxOptimalRegisterCount()) {
        // Try to see if we can squeeze it under the register count bar
        resultMeth = optimizeMinimizeRegisters(rmeth, paramWidth, isStatic,
                steps);
    }
    return resultMeth;
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:36,
代码来源:Optimizer.java

示例2: optimizeMinimizeRegisters

点赞 3

import com.android.dx.ssa.back.SsaToRop; //导入依赖的package包/类
/**
 * Runs the optimizer with a strategy to minimize the number of rop-form
 * registers used by the end result. Dex bytecode does not have instruction
 * forms that take register numbers larger than 15 for all instructions.
 * If we've produced a method that uses more than 16 registers, try again
 * with a different strategy to see if we can get under the bar. The end
 * result will be much more efficient.
 *
 * @param rmeth method to process
 * @param paramWidth the total width, in register-units, of this method's
 * parameters
 * @param isStatic true if this method has no 'this' pointer argument.
 * @param steps set of optional optimization steps to run
 * @return optimized method
 */
private static RopMethod optimizeMinimizeRegisters(RopMethod rmeth,
        int paramWidth, boolean isStatic,
        EnumSet<OptionalStep> steps) {
    SsaMethod ssaMeth;
    RopMethod resultMeth;

    ssaMeth = SsaConverter.convertToSsaMethod(
            rmeth, paramWidth, isStatic);

    EnumSet<OptionalStep> newSteps = steps.clone();

    /*
     * CONST_COLLECTOR trades insns for registers, which is not an
     * appropriate strategy here.
     */
    newSteps.remove(OptionalStep.CONST_COLLECTOR);

    runSsaFormSteps(ssaMeth, newSteps);

    resultMeth = SsaToRop.convertToRopMethod(ssaMeth, true);
    return resultMeth;
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:38,
代码来源:Optimizer.java

示例3: optimize

点赞 3

import com.android.dx.ssa.back.SsaToRop; //导入依赖的package包/类
/**
 * Runs optimization algorthims over this method, and returns a new
 * instance of RopMethod with the changes.
 *
 * @param rmeth method to process
 * @param paramWidth the total width, in register-units, of this method's
 * parameters
 * @param isStatic true if this method has no 'this' pointer argument.
 * @param inPreserveLocals true if local variable info should be preserved,
 * at the cost of some registers and insns
 * @param inAdvice {@code non-null;} translation advice
 * @param steps set of optional optimization steps to run
 * @return optimized method
 */
public RopMethod optimize(RopMethod rmeth, int paramWidth,
        boolean isStatic, boolean inPreserveLocals,
        TranslationAdvice inAdvice, EnumSet<OptionalStep> steps) {
    SsaMethod ssaMeth = null;

    preserveLocals = inPreserveLocals;
    advice = inAdvice;

    ssaMeth = SsaConverter.convertToSsaMethod(this, rmeth, paramWidth, isStatic);
    runSsaFormSteps(ssaMeth, steps);

    RopMethod resultMeth = SsaToRop.convertToRopMethod(this, ssaMeth, false);

    if (resultMeth.getBlocks().getRegCount()
            > advice.getMaxOptimalRegisterCount()) {
        // Try to see if we can squeeze it under the register count bar
        resultMeth = optimizeMinimizeRegisters(rmeth, paramWidth, isStatic,
                steps);
    }
    return resultMeth;
}
 

开发者ID:saleehk,
项目名称:buck-cutom,
代码行数:36,
代码来源:Optimizer.java

示例4: optimizeMinimizeRegisters

点赞 3

import com.android.dx.ssa.back.SsaToRop; //导入依赖的package包/类
/**
 * Runs the optimizer with a strategy to minimize the number of rop-form
 * registers used by the end result. Dex bytecode does not have instruction
 * forms that take register numbers larger than 15 for all instructions.
 * If we've produced a method that uses more than 16 registers, try again
 * with a different strategy to see if we can get under the bar. The end
 * result will be much more efficient.
 *
 * @param rmeth method to process
 * @param paramWidth the total width, in register-units, of this method's
 * parameters
 * @param isStatic true if this method has no 'this' pointer argument.
 * @param steps set of optional optimization steps to run
 * @return optimized method
 */
private RopMethod optimizeMinimizeRegisters(RopMethod rmeth,
        int paramWidth, boolean isStatic,
        EnumSet<OptionalStep> steps) {
    SsaMethod ssaMeth;
    RopMethod resultMeth;

    ssaMeth = SsaConverter.convertToSsaMethod(
            this, rmeth, paramWidth, isStatic);

    EnumSet<OptionalStep> newSteps = steps.clone();

    /*
     * CONST_COLLECTOR trades insns for registers, which is not an
     * appropriate strategy here.
     */
    newSteps.remove(OptionalStep.CONST_COLLECTOR);

    runSsaFormSteps(ssaMeth, newSteps);

    resultMeth = SsaToRop.convertToRopMethod(this, ssaMeth, true);
    return resultMeth;
}
 

开发者ID:saleehk,
项目名称:buck-cutom,
代码行数:38,
代码来源:Optimizer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)