Package com.android.dx.cf.code
Class ReturnAddress
java.lang.Object
com.android.dx.cf.code.ReturnAddress
- All Implemented Interfaces:
TypeBearer
,ToHuman
Representation of a subroutine return address. In Java verification,
somewhat counterintuitively, the salient bit of information you need to
know about a return address is the start address of the subroutine
being returned from, not the address being returned to, so that's
what instances of this class hang onto.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Gets the basic type corresponding to this instance's frame type.int
Gets the basic type corresponding to this instance.Gets the frame type corresponding to this type.int
Gets the subroutine address.getType()
Gets the type associated with this instance.int
hashCode()
boolean
Returns whether this instance represents a constant value.toHuman()
Return the "human" string form of this instance.toString()
-
Constructor Details
-
ReturnAddress
public ReturnAddress(int subroutineAddress) Constructs an instance.- Parameters:
subroutineAddress
->= 0;
the start address of the subroutine being returned from
-
-
Method Details
-
toString
-
toHuman
Return the "human" string form of this instance. This is generally less "debuggy" thantoString()
. -
getType
Gets the type associated with this instance.- Specified by:
getType
in interfaceTypeBearer
- Returns:
non-null;
the type
-
getFrameType
Gets the frame type corresponding to this type. This method returnsthis
, except ifType.isIntlike()
on the underlying type returnstrue
but the underlying type is not in factType.INT
, in which case this method returns an instance whose underlying type isINT
.- Specified by:
getFrameType
in interfaceTypeBearer
- Returns:
non-null;
the frame type for this instance
-
getBasicType
public int getBasicType()Gets the basic type corresponding to this instance.- Specified by:
getBasicType
in interfaceTypeBearer
- Returns:
- the basic type; one of the
BT_*
constants defined byType
-
getBasicFrameType
public int getBasicFrameType()Gets the basic type corresponding to this instance's frame type. This is equivalent togetFrameType().getBasicType()
, and is the same as callinggetFrameType()
unless this instance is an int-like type, in which case this method returnsBT_INT
.- Specified by:
getBasicFrameType
in interfaceTypeBearer
- Returns:
- the basic frame type; one of the
BT_*
constants defined byType
- See Also:
-
isConstant
public boolean isConstant()Returns whether this instance represents a constant value.- Specified by:
isConstant
in interfaceTypeBearer
- Returns:
true
if this instance represents a constant value andfalse
if not
-
equals
-
hashCode
public int hashCode() -
getSubroutineAddress
public int getSubroutineAddress()Gets the subroutine address.- Returns:
>= 0;
the subroutine address
-