|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.rop.code.Insn
public abstract class Insn
A register-based instruction. An instruction is the combination of an opcode (which specifies operation and source/result types), a list of actual sources and result registers/values, and additional information.
| Nested Class Summary | |
|---|---|
static class |
Insn.BaseVisitor
Base implementation of Insn.Visitor, which has empty method
bodies for all methods. |
static interface |
Insn.Visitor
Visitor interface for this (outer) class. |
| Constructor Summary | |
|---|---|
Insn(Rop opcode,
SourcePosition position,
RegisterSpec result,
RegisterSpecList sources)
Constructs an instance. |
|
| Method Summary | |
|---|---|
abstract void |
accept(Insn.Visitor visitor)
Calls the appropriate method on the given visitor, depending on the class of this instance. |
boolean |
canThrow()
Gets whether this instruction can possibly throw an exception. |
boolean |
contentEquals(Insn b)
Compares Insn contents, since Insn.equals() is defined
to be an identity compare. |
Insn |
copy()
Returns an exact copy of this Insn |
boolean |
equals(Object other)
Instances of this class compare by identity. |
abstract TypeList |
getCatches()
Gets the list of possibly-caught exceptions. |
String |
getInlineString()
Gets an "inline" string portion for toHuman(), if available. |
RegisterSpec |
getLocalAssignment()
Gets the spec of a local variable assignment that occurs at this instruction, or null if no local variable assignment occurs. |
Rop |
getOpcode()
Gets the opcode. |
SourcePosition |
getPosition()
Gets the source position. |
RegisterSpec |
getResult()
Gets the result spec, if any. |
RegisterSpecList |
getSources()
Gets the source specs. |
int |
hashCode()
This implementation returns the identity hashcode of this instance. |
String |
toHuman()
Gets a human-oriented (and slightly lossy) string for this instance. |
protected String |
toHumanWithInline(String extra)
Returns the human string form of this instance, with the given bit added in the standard location for an inline argument. |
String |
toString()
|
protected String |
toStringWithInline(String extra)
Returns the string form of this instance, with the given bit added in the standard location for an inline argument. |
abstract Insn |
withAddedCatch(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. |
abstract Insn |
withNewRegisters(RegisterSpec result,
RegisterSpecList sources)
Returns an instance that is just like this one, except with new result and source registers. |
abstract 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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Insn(Rop opcode,
SourcePosition position,
RegisterSpec result,
RegisterSpecList sources)
opcode - non-null; the opcodeposition - non-null; source positionresult - null-ok; spec for the result, if anysources - non-null; specs for all the sources| Method Detail |
|---|
public final boolean equals(Object other)
x.equals(y) is only true if x == y.
equals in class Objectpublic final int hashCode()
equals(java.lang.Object)).
hashCode in class Objectpublic String toString()
toString in class Objectpublic String toHuman()
toHuman in interface ToHumannon-null; the human string formpublic String getInlineString()
null-ok; if non-null, the inline text for toHuman()public final Rop getOpcode()
non-null; the opcodepublic final SourcePosition getPosition()
non-null; the source positionpublic final RegisterSpec getResult()
null
means this instruction returns nothing.
null-ok; the result spec, if anypublic final RegisterSpec getLocalAssignment()
mark-local insns
it may be the source.
null-ok; a named register spec or nullpublic final RegisterSpecList getSources()
non-null; the source specspublic final boolean canThrow()
getOpcode().canThrow().
true iff this instruction can possibly throwpublic abstract TypeList getCatches()
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 canThrow().
non-null; the catches listpublic abstract void accept(Insn.Visitor visitor)
visitor - non-null; the visitor to call onpublic abstract Insn withAddedCatch(Type type)
canThrow().
type - non-null; type to append to the catch list
non-null; an appropriately-constructed instancepublic abstract Insn withRegisterOffset(int delta)
delta - the amount to offset register references by
non-null; an appropriately-constructed instancepublic Insn withSourceLiteral()
this is returned in cases where the
translation is not possible.
non-null; an appropriately-constructed instancepublic Insn copy()
non-null; an appropriately-constructed instancepublic boolean contentEquals(Insn b)
Insn.equals() is defined
to be an identity compare. Insn's are contentEquals()
if they have the same opcode, registers, source position, and other
metadata.
public abstract Insn withNewRegisters(RegisterSpec result,
RegisterSpecList sources)
result - null-ok; new result registersources - non-null; new sources registers
non-null; an appropriately-constructed instanceprotected final String toStringWithInline(String extra)
extra - null-ok; the inline argument string
non-null; the string formprotected final String toHumanWithInline(String extra)
extra - null-ok; the inline argument string
non-null; the human string form
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||