本文整理汇总了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);
}
示例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);
}
示例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();
}
}