|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.rop.code.RegisterSpec
public final class RegisterSpec
Combination of a register number and a type, used as the sources and destinations of register-based operations.
| Field Summary | |
|---|---|
static String |
PREFIX
non-null; string to prefix register numbers with |
| Method Summary | |
|---|---|
int |
compareTo(RegisterSpec other)
Compares by (in priority order) register number, unwrapped type (that is types not TypeBearers, and local info. |
boolean |
equals(Object other)
|
boolean |
equalsUsingSimpleType(RegisterSpec other)
Like equals, but only consider the simple types of the
registers. |
int |
getBasicFrameType()
Gets the basic type corresponding to this instance's frame type. |
int |
getBasicType()
Gets the basic type corresponding to this instance. |
int |
getCategory()
Gets the category of this instance's type. |
TypeBearer |
getFrameType()
Gets the frame type corresponding to this type. |
LocalItem |
getLocalItem()
Gets the variable info associated with this instance, if any. |
int |
getNextReg()
Gets the next available register number after the one in this instance. |
int |
getReg()
Gets the register number. |
Type |
getType()
Gets the type associated with this instance. |
TypeBearer |
getTypeBearer()
Gets the type (or actual value) which is loaded from or stored to the register associated with this instance. |
int |
hashCode()
|
RegisterSpec |
intersect(RegisterSpec other,
boolean localPrimary)
Returns an instance that is the intersection between this instance and the given one, if any. |
boolean |
isCategory1()
Gets whether this instance's type is category 1. |
boolean |
isCategory2()
Gets whether this instance's type is category 2. |
boolean |
isConstant()
Returns whether this instance represents a constant value. |
boolean |
isEvenRegister()
|
static RegisterSpec |
make(int reg,
TypeBearer type)
Returns an instance for the given register number and type, with no variable info. |
static RegisterSpec |
make(int reg,
TypeBearer type,
LocalItem local)
Returns an instance for the given register number, type, and variable info. |
static RegisterSpec |
makeLocalOptional(int reg,
TypeBearer type,
LocalItem local)
Returns an instance for the given register number, type, and variable info. |
boolean |
matchesVariable(RegisterSpec other)
Like equalsUsingSimpleType(com.android.dx.rop.code.RegisterSpec) but ignoring the register number. |
String |
regString()
Gets the string form for just the register number of this instance. |
static String |
regString(int reg)
Gets the string form for the given register number. |
String |
toHuman()
Return the "human" string form of this instance. |
String |
toString()
|
RegisterSpec |
withLocalItem(LocalItem local)
Returns an instance that is identical to this one except that the local variable is as specified in the parameter. |
RegisterSpec |
withOffset(int delta)
Returns an instance that is identical to this one, except that the register number is offset by the given amount. |
RegisterSpec |
withReg(int newReg)
Returns an instance that is identical to this one, except that the register number is replaced by the given one. |
RegisterSpec |
withSimpleType()
Returns an instance that is identical to this one, except that the type bearer is replaced by the actual underlying type (thereby stripping off non-type information) with any initialization information stripped away as well. |
RegisterSpec |
withType(TypeBearer newType)
Returns an instance that is identical to this one, except that the type is replaced by the given one. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PREFIX
non-null; string to prefix register numbers with
| Method Detail |
|---|
public static RegisterSpec make(int reg,
TypeBearer type)
reg - >= 0; the register numbertype - non-null; the type (or possibly actual value) which
is loaded from or stored to the indicated register
non-null; an appropriately-constructed instance
public static RegisterSpec make(int reg,
TypeBearer type,
LocalItem local)
reg - >= 0; the register numbertype - non-null; the type (or possibly actual value) which
is loaded from or stored to the indicated registerlocal - non-null; the associated local variable
non-null; an appropriately-constructed instance
public static RegisterSpec makeLocalOptional(int reg,
TypeBearer type,
LocalItem local)
reg - >= 0; the register numbertype - non-null; the type (or possibly actual value) which
is loaded from or stored to the indicated registerlocal - null-ok; the associated variable info or null for
none
non-null; an appropriately-constructed instancepublic static String regString(int reg)
reg - >= 0; the register number
non-null; the string formpublic boolean equals(Object other)
equals in class Objectpublic boolean equalsUsingSimpleType(RegisterSpec other)
equals, but only consider the simple types of the
registers. That is, this compares getType() on the types
to ignore whatever arbitrary extra stuff might be carried around
by an outer TypeBearer.
other - null-ok; spec to compare to
true iff this and other are equal
in the stated waypublic boolean matchesVariable(RegisterSpec other)
equalsUsingSimpleType(com.android.dx.rop.code.RegisterSpec) but ignoring the register number.
This is useful to determine if two instances refer to the "same"
local variable.
other - null-ok; spec to compare to
true iff this and other are equal
in the stated waypublic int compareTo(RegisterSpec other)
TypeBearers, and local info.
compareTo in interface Comparable<RegisterSpec>other - non-null; spec to compare to
-1..1; standard result of comparisonpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic String toHuman()
toString().
toHuman in interface ToHumannon-null; the human string formpublic Type getType()
getType in interface TypeBearernon-null; the typepublic TypeBearer getFrameType()
this, except if Type.isIntlike() on the underlying
type returns true but the underlying type is not in
fact Type.INT, in which case this method returns an instance
whose underlying type is INT.
getFrameType in interface TypeBearernon-null; the frame type for this instancepublic final int getBasicType()
getBasicType in interface TypeBearerBT_* constants
defined by Typepublic final int getBasicFrameType()
getFrameType().getBasicType(), and
is the same as calling getFrameType() unless this
instance is an int-like type, in which case this method returns
BT_INT.
getBasicFrameType in interface TypeBearerBT_* constants
defined by TypeTypeBearer.getBasicType(),
TypeBearer.getFrameType()public final boolean isConstant()
isConstant in interface TypeBearertrue if this instance represents a constant value
and false if notpublic int getReg()
>= 0; the register numberpublic TypeBearer getTypeBearer()
non-null; the typepublic LocalItem getLocalItem()
null-ok; the variable info, or null if this
instance has nonepublic int getNextReg()
>= 0; the required registers sizepublic int getCategory()
getType().getCategory().
1..2; the category of this instance's typeisCategory1(),
isCategory2()public boolean isCategory1()
getType().isCategory1().
getCategory(),
isCategory2()public boolean isCategory2()
getType().isCategory2().
getCategory(),
isCategory1()public String regString()
non-null; the register string form
public RegisterSpec intersect(RegisterSpec other,
boolean localPrimary)
other is null, then the result
is null.
null. Otherwise, the register number of the
intersection is the same as the one in the two instances.getType() are not
equals(), then the intersection is null.getTypeBearer()
are equals(), then the intersection's type bearer
is the one from this instance. Otherwise, the intersection's
type bearer is the getType() of this instance.equals(), then the local info
of the intersection is the local info of this instance. Otherwise,
the local info of the intersection is null.
other - null-ok; instance to intersect with (or null)localPrimary - whether local variables are primary to the
intersection; if true, then the only non-null
results occur when registers being intersected have equal local
infos (or both have null local infos)
null-ok; the intersectionpublic RegisterSpec withReg(int newReg)
newReg - >= 0; the new register number
non-null; an appropriately-constructed instancepublic RegisterSpec withType(TypeBearer newType)
newType - non-null; the new type
non-null; an appropriately-constructed instancepublic RegisterSpec withOffset(int delta)
delta - the amount to offset the register number by
non-null; an appropriately-constructed instancepublic RegisterSpec withSimpleType()
non-null; an appropriately-constructed instancepublic RegisterSpec withLocalItem(LocalItem local)
local - null-ok; the local item or null for none
public boolean isEvenRegister()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||