Methods Summary |
---|
public abstract void | accept(com.android.dx.rop.code.Insn$Visitor visitor)Calls the appropriate method on the given visitor, depending on the
class of this instance. Subclasses must override this.
|
public final boolean | canThrow()Gets whether this instruction can possibly throw an exception. This
is just a convenient wrapper for {@code getOpcode().canThrow()}.
return opcode.canThrow();
|
public boolean | contentEquals(com.android.dx.rop.code.Insn b)Compares Insn contents, since {@code Insn.equals()} is defined
to be an identity compare. Insn's are {@code contentEquals()}
if they have the same opcode, registers, source position, and other
metadata.
return opcode == b.getOpcode()
&& position.equals(b.getPosition())
&& (getClass() == b.getClass())
&& equalsHandleNulls(result, b.getResult())
&& equalsHandleNulls(sources, b.getSources())
&& StdTypeList.equalContents(getCatches(), b.getCatches());
|
public com.android.dx.rop.code.Insn | copy()Returns an exact copy of this Insn
return withRegisterOffset(0);
|
public final boolean | equals(java.lang.Object other){@inheritDoc}
Instances of this class compare by identity. That is,
{@code x.equals(y)} is only true if {@code x == y}.
return (this == other);
|
private static boolean | equalsHandleNulls(java.lang.Object a, java.lang.Object b)Compares, handling nulls safely
return (a == b) || ((a != null) && a.equals(b));
|
public abstract com.android.dx.rop.type.TypeList | getCatches()Gets the list of possibly-caught exceptions. This returns {@link
StdTypeList#EMPTY} if this instruction has no handlers,
which can be either if this instruction can't possibly
throw or if it merely doesn't handle any of its possible
exceptions. To determine whether this instruction can throw,
use {@link #canThrow}.
|
public java.lang.String | getInlineString()Gets an "inline" string portion for toHuman(), if available. This
is the portion that appears after the Rop opcode
return null;
|
public final RegisterSpec | getLocalAssignment()Gets the spec of a local variable assignment that occurs at this
instruction, or null if no local variable assignment occurs. This
may be the result register, or for {@code mark-local} insns
it may be the source.
RegisterSpec assignment;
if (opcode.getOpcode() == RegOps.MARK_LOCAL) {
assignment = sources.get(0);
} else {
assignment = result;
}
if (assignment == null) {
return null;
}
LocalItem localItem = assignment.getLocalItem();
if (localItem == null) {
return null;
}
return assignment;
|
public final Rop | getOpcode()Gets the opcode.
return opcode;
|
public final SourcePosition | getPosition()Gets the source position.
return position;
|
public final RegisterSpec | getResult()Gets the result spec, if any. A return value of {@code null}
means this instruction returns nothing.
return result;
|
public final RegisterSpecList | getSources()Gets the source specs.
return sources;
|
public final int | hashCode(){@inheritDoc}
This implementation returns 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 | toHuman()Gets a human-oriented (and slightly lossy) string for this instance.
return toHumanWithInline(getInlineString());
|
protected final java.lang.String | toHumanWithInline(java.lang.String extra)Returns the human string form of this instance, with the given
bit added in the standard location for an inline argument.
StringBuffer sb = new StringBuffer(80);
sb.append(position);
sb.append(": ");
sb.append(opcode.getNickname());
if (extra != null) {
sb.append("(");
sb.append(extra);
sb.append(")");
}
if (result == null) {
sb.append(" .");
} else {
sb.append(" ");
sb.append(result.toHuman());
}
sb.append(" <-");
int sz = sources.size();
if (sz == 0) {
sb.append(" .");
} else {
for (int i = 0; i < sz; i++) {
sb.append(" ");
sb.append(sources.get(i).toHuman());
}
}
return sb.toString();
|
public java.lang.String | toString(){@inheritDoc}
return toStringWithInline(getInlineString());
|
protected final java.lang.String | toStringWithInline(java.lang.String extra)Returns the string form of this instance, with the given bit added in
the standard location for an inline argument.
StringBuffer sb = new StringBuffer(80);
sb.append("Insn{");
sb.append(position);
sb.append(' ");
sb.append(opcode);
if (extra != null) {
sb.append(' ");
sb.append(extra);
}
sb.append(" :: ");
if (result != null) {
sb.append(result);
sb.append(" <- ");
}
sb.append(sources);
sb.append('}");
return sb.toString();
|
public abstract com.android.dx.rop.code.Insn | withAddedCatch(com.android.dx.rop.type.Type type)Returns an instance that is just like this one, except that it
has a catch list with the given item appended to the end. This
method throws an exception if this instance can't possibly
throw. To determine whether this instruction can throw, use
{@link #canThrow}.
|
public abstract com.android.dx.rop.code.Insn | withNewRegisters(RegisterSpec result, RegisterSpecList sources)Returns an instance that is just like this one, except
with new result and source registers.
|
public abstract com.android.dx.rop.code.Insn | withRegisterOffset(int delta)Returns an instance that is just like this one, except that all
register references have been offset by the given delta.
|
public com.android.dx.rop.code.Insn | withSourceLiteral()Returns an instance that is just like this one, except that, if
possible, the insn is converted into a version in which a source
(if it is a constant) is represented directly rather than as a
register reference. {@code this} is returned in cases where the
translation is not possible.
return this;
|