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


Java Rop.BRANCH_THROW属性代码示例

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


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

示例1: visitThrowingInsn

/** {@inheritDoc} */
public void visitThrowingInsn(ThrowingInsn insn) {
    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    Rop rop = insn.getOpcode();
    RegisterSpec realResult;

    if (rop.getBranchingness() != Rop.BRANCH_THROW) {
        throw new RuntimeException("shouldn't happen");
    }

    realResult = getNextMoveResultPseudo();

    if (opcode.hasResult() != (realResult != null)) {
        throw new RuntimeException(
                "Insn with result/move-result-pseudo mismatch" + insn);
    }

    addOutput(lastAddress);

    DalvInsn di = new SimpleInsn(opcode, pos,
            getRegs(insn, realResult));

    addOutput(di);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:25,代码来源:RopTranslator.java

示例2: visitPlainInsn

/** {@inheritDoc} */
public void visitPlainInsn(PlainInsn insn) {
    Rop rop = insn.getOpcode();
    if (rop.getOpcode() == RegOps.MARK_LOCAL) {
        /*
         * Ignore these. They're dealt with by
         * the LocalVariableAwareTranslationVisitor
         */
        return;
    }
    if (rop.getOpcode() == RegOps.MOVE_RESULT_PSEUDO) {
        // These get skipped
        return;
    }

    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    DalvInsn di;

    switch (rop.getBranchingness()) {
        case Rop.BRANCH_NONE:
        case Rop.BRANCH_RETURN:
        case Rop.BRANCH_THROW: {
            di = new SimpleInsn(opcode, pos, getRegs(insn));
            break;
        }
        case Rop.BRANCH_GOTO: {
            /*
             * Code in the main translation loop will emit a
             * goto if necessary (if the branch isn't to the
             * immediately subsequent block).
             */
            return;
        }
        case Rop.BRANCH_IF: {
            int target = block.getSuccessors().get(1);
            di = new TargetInsn(opcode, pos, getRegs(insn),
                                addresses.getStart(target));
            break;
        }
        default: {
            throw new RuntimeException("shouldn't happen");
        }
    }

    addOutput(di);
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:47,代码来源:RopTranslator.java

示例3: addInstruction

/**
 * @param branch the branches to follow; interpretation depends on the
 *     instruction's branchingness.
 */
private void addInstruction(Insn insn, Label branch) {
    if (currentLabel == null || !currentLabel.marked) {
        throw new IllegalStateException("no current label");
    }
    currentLabel.instructions.add(insn);

    switch (insn.getOpcode().getBranchingness()) {
    case BRANCH_NONE:
        if (branch != null) {
            throw new IllegalArgumentException("unexpected branch: " + branch);
        }
        return;

    case BRANCH_RETURN:
        if (branch != null) {
            throw new IllegalArgumentException("unexpected branch: " + branch);
        }
        currentLabel = null;
        break;

    case BRANCH_GOTO:
        if (branch == null) {
            throw new IllegalArgumentException("branch == null");
        }
        currentLabel.primarySuccessor = branch;
        currentLabel = null;
        break;

    case Rop.BRANCH_IF:
        if (branch == null) {
            throw new IllegalArgumentException("branch == null");
        }
        splitCurrentLabel(branch, Collections.<Label>emptyList());
        break;

    case Rop.BRANCH_THROW:
        if (branch != null) {
            throw new IllegalArgumentException("unexpected branch: " + branch);
        }
        splitCurrentLabel(null, new ArrayList<Label>(catchLabels));
        break;

    default:
        throw new IllegalArgumentException();
    }
}
 
开发者ID:linkedin,项目名称:dexmaker,代码行数:50,代码来源:Code.java


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