Methods Summary |
---|
public boolean | canThrow()Returns whether this block might throw an exception. This is
just a convenient shorthand for getLastInsn().canThrow() .
return insns.getLast().canThrow();
|
public boolean | equals(java.lang.Object other){@inheritDoc}
Instances of this class compare by identity. That is,
x.equals(y) is only true if x == y .
return (this == other);
|
public com.android.dx.rop.type.TypeList | getExceptionHandlerTypes()Returns the exception handler types associated with this block,
if any. This is just a shorthand for inspecting the last
instruction in the block to see if it could throw, and if so,
grabbing the catch list out of it. If not, this returns an
empty list (not null ).
Insn lastInsn = insns.getLast();
return lastInsn.getCatches();
|
public Insn | getFirstInsn()Gets the first instruction of this block. This is just a
convenient shorthand for getInsns().get(0) .
return insns.get(0);
|
public InsnList | getInsns()Gets the list of instructions inside this block.
return insns;
|
public int | getLabel()Gets the target label of this block.
return label;
|
public Insn | getLastInsn()Gets the last instruction of this block. This is just a
convenient shorthand for getInsns().getLast() .
return insns.getLast();
|
public int | getPrimarySuccessor()Gets the primary successor of this block.
return primarySuccessor;
|
public int | getSecondarySuccessor()Gets the secondary successor of this block. It is only valid to call
this method on blocks that have exactly two successors.
if (successors.size() != 2) {
throw new UnsupportedOperationException(
"block doesn't have exactly two successors");
}
int succ = successors.get(0);
if (succ == primarySuccessor) {
succ = successors.get(1);
}
return succ;
|
public com.android.dx.util.IntList | getSuccessors()Gets the list of successors that this block may branch to.
return successors;
|
public boolean | hasExceptionHandlers()Returns whether this block has any associated exception handlers.
This is just a shorthand for inspecting the last instruction in
the block to see if it could throw, and if so, whether it in fact
has any associated handlers.
Insn lastInsn = insns.getLast();
return lastInsn.getCatches().size() != 0;
|
public int | hashCode(){@inheritDoc}
Return the identity hashcode of this instance. This is proper,
since instances of this class compare by identity (see {@link #equals}).
return System.identityHashCode(this);
|
public java.lang.String | toString()
return '{" + Hex.u2(label) + '}";
|
public com.android.dx.rop.code.BasicBlock | withRegisterOffset(int delta)Returns an instance that is identical to this one, except that
the registers in each instruction are offset by the given
amount.
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
|