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


Java LocalVariableInfo类代码示例

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


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

示例1: updateDexStatistics

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Helper that updates the dex statistics.
 */
private static void updateDexStatistics(CfOptions cfOptions, DexOptions dexOptions,
        RopMethod optRmeth, RopMethod nonOptRmeth,
        LocalVariableInfo locals, int paramSize, int originalByteCount) {
    /*
     * Run rop->dex again on optimized vs. non-optimized method to
     * collect statistics. We have to totally convert both ways,
     * since converting the "real" method getting added to the
     * file would corrupt it (by messing with its constant pool
     * indices).
     */

    DalvCode optCode = RopTranslator.translate(optRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);
    DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);

    /*
     * Fake out the indices, so code.getInsns() can work well enough
     * for the current purpose.
     */

    DalvCode.AssignIndicesCallback callback =
        new DalvCode.AssignIndicesCallback() {
            public int getIndex(Constant cst) {
                // Everything is at index 0!
                return 0;
            }
        };

    optCode.assignIndices(callback);
    nonOptCode.assignIndices(callback);

    CodeStatistics.updateDexStatistics(nonOptCode, optCode);
    CodeStatistics.updateOriginalByteCount(originalByteCount);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:39,代码来源:CfTranslator.java

示例2: toEncodedMethod

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
EncodedMethod toEncodedMethod(DexOptions dexOptions) {
    RopMethod ropMethod = new RopMethod(code.toBasicBlocks(), 0);
    LocalVariableInfo locals = null;
    DalvCode dalvCode = RopTranslator.translate(
            ropMethod, PositionList.NONE, locals, code.paramSize(), dexOptions);
    return new EncodedMethod(method.constant, flags, dalvCode, StdTypeList.EMPTY);
}
 
开发者ID:linkedin,项目名称:dexmaker,代码行数:8,代码来源:DexMaker.java

示例3: updateDexStatistics

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Helper that updates the dex statistics.
 */
private static void updateDexStatistics(CfOptions cfOptions, DexOptions dexOptions,
        RopMethod optRmeth, RopMethod nonOptRmeth,
        LocalVariableInfo locals, int paramSize, int originalByteCount) {
    /*
     * Run rop->dex again on optimized vs. non-optimized method to
     * collect statistics. We have to totally convert both ways,
     * since converting the "real" method getting added to the
     * file would corrupt it (by messing with its constant pool
     * indices).
     */

    DalvCode optCode = RopTranslator.translate(optRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);
    DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);

    /*
     * Fake out the indices, so code.getInsns() can work well enough
     * for the current purpose.
     */

    DalvCode.AssignIndicesCallback callback =
        new DalvCode.AssignIndicesCallback() {
            public int getIndex(Constant cst) {
                // Everything is at index 0!
                return 0;
            }
        };

    optCode.assignIndices(callback);
    nonOptCode.assignIndices(callback);

    cfOptions.codeStatistics.updateDexStatistics(nonOptCode, optCode);
    cfOptions.codeStatistics.updateOriginalByteCount(originalByteCount);
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:39,代码来源:CfTranslator.java

示例4: updateDexStatistics

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Helper that updates the dex statistics.
 */
private static void updateDexStatistics(DxContext context, CfOptions cfOptions, DexOptions dexOptions,
                                        RopMethod optRmeth, RopMethod nonOptRmeth,
                                        LocalVariableInfo locals, int paramSize, int originalByteCount) {
    /*
     * Run rop->dex again on optimized vs. non-optimized method to
     * collect statistics. We have to totally convert both ways,
     * since converting the "real" method getting added to the
     * file would corrupt it (by messing with its constant pool
     * indices).
     */

    DalvCode optCode = RopTranslator.translate(optRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);
    DalvCode nonOptCode = RopTranslator.translate(nonOptRmeth,
            cfOptions.positionInfo, locals, paramSize, dexOptions);

    /*
     * Fake out the indices, so code.getInsns() can work well enough
     * for the current purpose.
     */

    DalvCode.AssignIndicesCallback callback =
        new DalvCode.AssignIndicesCallback() {
            public int getIndex(Constant cst) {
                // Everything is at index 0!
                return 0;
            }
        };

    optCode.assignIndices(callback);
    nonOptCode.assignIndices(callback);

    context.codeStatistics.updateDexStatistics(nonOptCode, optCode);
    context.codeStatistics.updateOriginalByteCount(originalByteCount);
}
 
开发者ID:facebook,项目名称:buck,代码行数:39,代码来源:CfTranslator.java

示例5: RopTranslator

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Constructs an instance. This method is private. Use {@link #translate}.
 *
 * @param method {@code non-null;} the original method
 * @param positionInfo how much position info to preserve; one of the
 * static constants in {@link PositionList}
 * @param locals {@code null-ok;} local variable information to use
 * @param paramSize size, in register units, of all the parameters to
 * this method
 * @param dexOptions {@code non-null;} options for dex output
 */
private RopTranslator(RopMethod method, int positionInfo, LocalVariableInfo locals,
        int paramSize, DexOptions dexOptions) {
    this.dexOptions = dexOptions;
    this.method = method;
    this.positionInfo = positionInfo;
    this.locals = locals;
    this.addresses = new BlockAddresses(method);
    this.paramSize = paramSize;
    this.order = null;
    this.paramsAreInOrder = calculateParamsAreInOrder(method, paramSize);

    BasicBlockList blocks = method.getBlocks();
    int bsz = blocks.size();

    /*
     * Max possible instructions includes three code address
     * objects per basic block (to the first and last instruction,
     * and just past the end of the block), and the possibility of
     * an extra goto at the end of each basic block.
     */
    int maxInsns = (bsz * 3) + blocks.getInstructionCount();

    if (locals != null) {
        /*
         * If we're tracking locals, then there's could be another
         * extra instruction per block (for the locals state at the
         * start of the block) as well as one for each interblock
         * local introduction.
         */
        maxInsns += bsz + locals.getAssignmentCount();
    }

    /*
     * If params are not in order, we will need register space
     * for them before this is all over...
     */
    this.regCount = blocks.getRegCount()
            + (paramsAreInOrder ? 0 : this.paramSize);

    this.output = new OutputCollector(dexOptions, maxInsns, bsz * 3, regCount, paramSize);

    if (locals != null) {
        this.translationVisitor =
            new LocalVariableAwareTranslationVisitor(output, locals);
    } else {
        this.translationVisitor = new TranslationVisitor(output);
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:60,代码来源:RopTranslator.java

示例6: RopTranslator

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Constructs an instance. This method is private. Use {@link #translate}.
 *
 * @param method {@code non-null;} the original method
 * @param positionInfo how much position info to preserve; one of the
 * static constants in {@link PositionList}
 * @param locals {@code null-ok;} local variable information to use
 * @param paramSize size, in register units, of all the parameters to
 * this method
 * @param dexOptions {@code non-null;} options for dex output
 */
private RopTranslator(RopMethod method, int positionInfo, LocalVariableInfo locals,
        int paramSize, DexOptions dexOptions) {
    this.dexOptions = dexOptions;
    this.method = method;
    this.positionInfo = positionInfo;
    this.locals = locals;
    this.addresses = new BlockAddresses(method);
    this.paramSize = paramSize;
    this.order = null;
    this.paramsAreInOrder = calculateParamsAreInOrder(method, paramSize);

    BasicBlockList blocks = method.getBlocks();
    int bsz = blocks.size();

    /*
     * Max possible instructions includes three code address
     * objects per basic block (to the first and last instruction,
     * and just past the end of the block), and the possibility of
     * an extra goto at the end of each basic block.
     */
    int maxInsns = (bsz * 3) + blocks.getInstructionCount();

    if (locals != null) {
        /*
         * If we're tracking locals, then there's could be another
         * extra instruction per block (for the locals state at the
         * start of the block) as well as one for each interblock
         * local introduction.
         */
        maxInsns += bsz + locals.getAssignmentCount();
    }

    /*
     * If params are not in order, we will need register space
     * for them before this is all over...
     */
    this.regCount = blocks.getRegCount()
            + (paramsAreInOrder ? 0 : this.paramSize);

    this.output = new OutputCollector(dexOptions, maxInsns, bsz * 3, regCount);

    if (locals != null) {
        this.translationVisitor =
            new LocalVariableAwareTranslationVisitor(output, locals);
    } else {
        this.translationVisitor = new TranslationVisitor(output);
    }
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:60,代码来源:RopTranslator.java

示例7: translate

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Translates a {@link RopMethod}. This may modify the given
 * input.
 *
 * @param method {@code non-null;} the original method
 * @param positionInfo how much position info to preserve; one of the
 * static constants in {@link PositionList}
 * @param locals {@code null-ok;} local variable information to use
 * @param paramSize size, in register units, of all the parameters to
 * this method
 * @param dexOptions {@code non-null;} options for dex output
 * @return {@code non-null;} the translated version
 */
public static DalvCode translate(RopMethod method, int positionInfo,
        LocalVariableInfo locals, int paramSize, DexOptions dexOptions) {
    RopTranslator translator =
        new RopTranslator(method, positionInfo, locals, paramSize, dexOptions);
    return translator.translateAndGetResult();
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:20,代码来源:RopTranslator.java

示例8: LocalVariableAwareTranslationVisitor

import com.android.dx.rop.code.LocalVariableInfo; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param output {@code non-null;} destination for instruction output
 * @param locals {@code non-null;} the local variable info
 */
public LocalVariableAwareTranslationVisitor(OutputCollector output,
                                            LocalVariableInfo locals) {
    super(output);
    this.locals = locals;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:12,代码来源:RopTranslator.java


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