• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LocalVariableInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TedPermission类代码示例发布时间:2022-05-23
下一篇:
Java TexturePackParseException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap