本文整理汇总了Java中com.android.dx.rop.code.Rops.GOTO属性的典型用法代码示例。如果您正苦于以下问题:Java Rops.GOTO属性的具体用法?Java Rops.GOTO怎么用?Java Rops.GOTO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.dx.rop.code.Rops
的用法示例。
在下文中一共展示了Rops.GOTO属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteInsns
/**
* Deletes all insns in the set from this method.
*
* @param deletedInsns {@code non-null;} insns to delete
*/
public void deleteInsns(Set<SsaInsn> deletedInsns) {
for (SsaBasicBlock block : getBlocks()) {
ArrayList<SsaInsn> insns = block.getInsns();
for (int i = insns.size() - 1; i >= 0; i--) {
SsaInsn insn = insns.get(i);
if (deletedInsns.contains(insn)) {
onInsnRemoved(insn);
insns.remove(i);
}
}
// Check to see if we need to add a GOTO
int insnsSz = insns.size();
SsaInsn lastInsn = (insnsSz == 0) ? null : insns.get(insnsSz - 1);
if (block != getExitBlock() && (insnsSz == 0
|| lastInsn.getOriginalRopInsn() == null
|| lastInsn.getOriginalRopInsn().getOpcode()
.getBranchingness() == Rop.BRANCH_NONE)) {
// We managed to eat a throwable insn
Insn gotoInsn = new PlainInsn(Rops.GOTO,
SourcePosition.NO_INFO, null, RegisterSpecList.EMPTY);
insns.add(SsaInsn.makeFromRop(gotoInsn, block));
// Remove secondary successors from this block
BitSet succs = block.getSuccessors();
for (int i = succs.nextSetBit(0); i >= 0;
i = succs.nextSetBit(i + 1)) {
if (i != block.getPrimarySuccessorIndex()) {
block.removeSuccessor(i);
}
}
}
}
}
示例2: getGoto
/**
* Gets a new {@code GOTO} insn.
*
* @param block block to which this GOTO will be added
* (not it's destination!)
* @return an appropriately-constructed instance.
*/
private static SsaInsn getGoto(SsaBasicBlock block) {
return new NormalSsaInsn (
new PlainInsn(Rops.GOTO, SourcePosition.NO_INFO,
null, RegisterSpecList.EMPTY), block);
}