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

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

java 1次浏览

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

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

示例1: addConstants

点赞 3

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Helper for {@link #getAllConstants} which adds all the info for
 * a single {@code RegisterSpec}.
 *
 * @param result {@code non-null;} result set to add to
 * @param spec {@code null-ok;} register spec to add
 */
private static void addConstants(HashSet<Constant> result,
        RegisterSpec spec) {
    if (spec == null) {
        return;
    }

    LocalItem local = spec.getLocalItem();
    CstString name = local.getName();
    CstString signature = local.getSignature();
    Type type = spec.getType();

    if (type != Type.KNOWN_NULL) {
        result.add(CstType.intern(type));
    }

    if (name != null) {
        result.add(name);
    }

    if (signature != null) {
        result.add(signature);
    }
}
 

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

示例2: getLocalAssignment

点赞 3

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public RegisterSpec getLocalAssignment() {
    RegisterSpec assignment;

    if (insn.getOpcode().getOpcode() == RegOps.MARK_LOCAL) {
        assignment = insn.getSources().get(0);
    } else {
        assignment = getResult();
    }

    if (assignment == null) {
        return null;
    }

    LocalItem local = assignment.getLocalItem();

    if (local == null) {
        return null;
    }

    return assignment;
}
 

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

示例3: printLocalVars

点赞 3

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Dumps local variable table to stdout for debugging.
 */
private void printLocalVars() {
    System.out.println("Printing local vars");
    for (Map.Entry<LocalItem, ArrayList<RegisterSpec>> e :
            localVariables.entrySet()) {
        StringBuilder regs = new StringBuilder();

        regs.append('{');
        regs.append(' ');
        for (RegisterSpec reg : e.getValue()) {
            regs.append('v');
            regs.append(reg.getReg());
            regs.append(' ');
        }
        regs.append('}');
        System.out.printf("Local: %s Registers: %s\n", e.getKey(), regs);
    }
}
 

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

示例4: setResultLocal

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Sets the local association for the result of this insn. This is
 * sometimes updated during the SsaRenamer process.
 *
 * @param local {@code null-ok;} new debug/local variable info
 */
public final void setResultLocal(LocalItem local) {
    LocalItem oldItem = result.getLocalItem();

    if (local != oldItem && (local == null
            || !local.equals(result.getLocalItem()))) {
        result = RegisterSpec.makeLocalOptional(
                result.getReg(), result.getType(), local);
    }
}
 

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

示例5: fixLocalAssignment

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Inserts mark-locals if necessary when changing a register. If
 * the definition of {@code origReg} is associated with a local
 * variable, then insert a mark-local for {@code newReg} just below
 * it. We expect the definition of  {@code origReg} to ultimately
 * be removed by the dead code eliminator
 *
 * @param origReg {@code non-null;} original register
 * @param newReg {@code non-null;} new register that will replace
 * {@code origReg}
 */
private void fixLocalAssignment(RegisterSpec origReg,
        RegisterSpec newReg) {
    for (SsaInsn use : ssaMeth.getUseListForRegister(origReg.getReg())) {
        RegisterSpec localAssignment = use.getLocalAssignment();
        if (localAssignment == null) {
            continue;
        }

        if (use.getResult() == null) {
            /*
             * This is a mark-local. it will be updated when all uses
             * are updated.
             */
            continue;
        }

        LocalItem local = localAssignment.getLocalItem();

        // Un-associate original use.
        use.setResultLocal(null);

        // Now add a mark-local to the new reg immediately after.
        newReg = newReg.withLocalItem(local);

        SsaInsn newInsn
                = SsaInsn.makeFromRop(
                    new PlainInsn(Rops.opMarkLocal(newReg),
                    SourcePosition.NO_INFO, null,
                            RegisterSpecList.make(newReg)),
                use.getBlock());

        ArrayList<SsaInsn> insns = use.getBlock().getInsns();

        insns.add(insns.indexOf(use) + 1, newInsn);
    }
}
 

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

示例6: FirstFitLocalCombiningAllocator

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Constructs instance.
 *
 * @param ssaMeth {@code non-null;} method to process
 * @param interference non-null interference graph for SSA registers
 * @param minimizeRegisters true if converter should take steps to
 * minimize rop-form registers
 */
public FirstFitLocalCombiningAllocator(
        SsaMethod ssaMeth, InterferenceGraph interference,
        boolean minimizeRegisters) {
    super(ssaMeth, interference);

    ssaRegsMapped = new BitSet(ssaMeth.getRegCount());

    mapper = new InterferenceRegisterMapper(
            interference, ssaMeth.getRegCount());

    this.minimizeRegisters = minimizeRegisters;

    /*
     * Reserve space for the params at the bottom of the register
     * space. Later, we'll flip the params to the end of the register
     * space.
     */

    paramRangeEnd = ssaMeth.getParamWidth();

    reservedRopRegs = new BitSet(paramRangeEnd * 2);
    reservedRopRegs.set(0, paramRangeEnd);
    usedRopRegs = new BitSet(paramRangeEnd * 2);
    localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>();
    moveResultPseudoInsns = new ArrayList<NormalSsaInsn>();
    invokeRangeInsns = new ArrayList<NormalSsaInsn>();
    phiInsns = new ArrayList<PhiInsn>();
}
 

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

示例7: getLocalItemForReg

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Gets a local item associated with an ssa register, if one exists.
 *
 * @param ssaReg {@code >= 0;} SSA register
 * @return {@code null-ok;} associated local item or null
 */
private LocalItem getLocalItemForReg(int ssaReg) {
    for (Map.Entry<LocalItem, ArrayList<RegisterSpec>> entry :
             localVariables.entrySet()) {
        for (RegisterSpec spec : entry.getValue()) {
            if (spec.getReg() == ssaReg) {
                return entry.getKey();
            }
        }
    }

    return null;
}
 

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

示例8: getLocalForNewReg

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Gets a local variable item for a specified register.
 *
 * @param ssaReg register in SSA name space
 * @return {@code null-ok;} Local variable name or null if none
 */
private LocalItem getLocalForNewReg(int ssaReg) {
    if (ssaReg < ssaRegToLocalItems.size()) {
        return ssaRegToLocalItems.get(ssaReg);
    } else {
        return null;
    }
}
 

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

示例9: setNameForSsaReg

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Records a debug (local variable) name for a specified register.
 *
 * @param ssaReg non-null named register spec in SSA name space
 */
private void setNameForSsaReg(RegisterSpec ssaReg) {
    int reg = ssaReg.getReg();
    LocalItem local = ssaReg.getLocalItem();

    ssaRegToLocalItems.ensureCapacity(reg + 1);
    while (ssaRegToLocalItems.size() <= reg) {
        ssaRegToLocalItems.add(null);
    }

    ssaRegToLocalItems.set(reg, local);
}
 

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

示例10: FirstFitLocalCombiningAllocator

点赞 2

import com.android.dx.rop.code.LocalItem; //导入依赖的package包/类
/**
 * Constructs instance.
 *
 * @param optimizer
 * @param ssaMeth {@code non-null;} method to process
 * @param interference non-null interference graph for SSA registers
 * @param minimizeRegisters true if converter should take steps to
 */
public FirstFitLocalCombiningAllocator(
        Optimizer optimizer,
        SsaMethod ssaMeth,
        InterferenceGraph interference,
        boolean minimizeRegisters) {
    super(ssaMeth, interference);
    this.optimizer = optimizer;

    ssaRegsMapped = new BitSet(ssaMeth.getRegCount());

    mapper = new InterferenceRegisterMapper(
            interference, ssaMeth.getRegCount());

    this.minimizeRegisters = minimizeRegisters;

    /*
     * Reserve space for the params at the bottom of the register
     * space. Later, we'll flip the params to the end of the register
     * space.
     */

    paramRangeEnd = ssaMeth.getParamWidth();

    reservedRopRegs = new BitSet(paramRangeEnd * 2);
    reservedRopRegs.set(0, paramRangeEnd);
    usedRopRegs = new BitSet(paramRangeEnd * 2);
    localVariables = new TreeMap<LocalItem, ArrayList<RegisterSpec>>();
    moveResultPseudoInsns = new ArrayList<NormalSsaInsn>();
    invokeRangeInsns = new ArrayList<NormalSsaInsn>();
    phiInsns = new ArrayList<PhiInsn>();
}
 

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


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