public final class LocationOperand extends Operand
Operand
Modifier and Type | Field and Description |
---|---|
static int |
ALENGTH_ACCESS
Enumeration of Access type
|
static int |
ARRAY_ACCESS
Enumeration of Access type
|
(package private) TypeReference |
arrayElementType
Array element type that corresponds to the type of the array that contains
this location;
null if this is not an array access. |
static int |
FIELD_ACCESS
Enumeration of Access type
|
(package private) FieldReference |
fieldRef
Field that corresponds to this location;
null if this is not a field access.
|
static int |
JTOC_ACCESS
Enumeration of Access type
|
(package private) Offset |
JTOCoffset
JTOC index that corresponds to this location
|
static int |
METHOD_ACCESS
Enumeration of Access type
|
(package private) MethodOperand |
methOp
Method operand that corresponds to this location;
null if this is not a method access. |
static int |
SPILL_ACCESS
Enumeration of Access type
|
(package private) int |
spillOffset
Spill offset that corresponds to this location
|
(package private) int |
type
The type of this location.
|
instruction
Constructor and Description |
---|
LocationOperand()
Constructs a new location operand for array length access.
|
LocationOperand(FieldReference loc)
Constructs a new location operand with the given field.
|
LocationOperand(int index)
Constructs a new location operand with the given spill offset.
|
LocationOperand(MethodOperand m)
Constructs a new location operand with the given method
|
LocationOperand(Offset jtocOffset)
Constructs a new location operand with the given JTOC offset
|
LocationOperand(RVMField loc)
Constructs a new location operand with the given field
|
LocationOperand(TypeReference t)
Constructs a new location operand with the given array element type.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
arrayMayBeAliased(TypeReference t1,
TypeReference t2) |
LocationOperand |
asALengthAccess() |
LocationOperand |
asArrayAccess() |
LocationOperand |
asFieldAccess() |
LocationOperand |
asJTOCAccess() |
LocationOperand |
asMethodAccess() |
LocationOperand |
asSpillAccess() |
Operand |
copy()
Return a new operand that is semantically equivalent to
this . |
TypeReference |
getElementType() |
FieldReference |
getFieldRef() |
Offset |
getJTOCoffset() |
int |
getOffset() |
TypeReference |
getType()
Return the
TypeReference of the value represented by the operand. |
boolean |
isALengthAccess() |
boolean |
isArrayAccess() |
boolean |
isFieldAccess() |
boolean |
isJTOCAccess() |
boolean |
isMethodAccess() |
boolean |
isSpillAccess() |
static boolean |
mayBeAliased(LocationOperand op1,
LocationOperand op2)
Returns true if operands op1 and op2 may be aliased.
|
boolean |
mayBeVolatile()
Is the accessed location possibly volatile?
|
boolean |
similar(Operand op)
Are two operands semantically equivalent?
|
String |
toString()
Returns the string representation of this operand.
|
asAddressConstant, asBlock, asBranch, asClassConstant, asCondition, asDoubleConstant, asFloatConstant, asIntConstant, asLocation, asLongConstant, asMemory, asMethod, asNullConstant, asObjectConstant, asRegister, asStackLocation, asStringConstant, asTIBConstant, asType, conservativelyApproximates, getIndexInInstruction, isAddress, isAddressConstant, isBlock, isBranch, isClassConstant, isConstant, isDefinitelyNull, isDouble, isDoubleConstant, isFloat, isFloatConstant, isInt, isIntConstant, isIntLike, isLocation, isLong, isLongConstant, isMemory, isMethod, isMovableObjectConstant, isNullConstant, isObjectConstant, isRef, isRegister, isStackLocation, isStringConstant, isTIBConstant, isTrueGuard, isType, meet
public static final int FIELD_ACCESS
public static final int ARRAY_ACCESS
public static final int JTOC_ACCESS
public static final int SPILL_ACCESS
public static final int ALENGTH_ACCESS
public static final int METHOD_ACCESS
int type
FieldReference fieldRef
MethodOperand methOp
null
if this is not a method access.TypeReference arrayElementType
null
if this is not an array access.Offset JTOCoffset
int spillOffset
public LocationOperand(FieldReference loc)
loc
- locationpublic LocationOperand(RVMField loc)
loc
- locationpublic LocationOperand(MethodOperand m)
m
- Method operand that corresponds to this locationpublic LocationOperand(TypeReference t)
t
- Array element typepublic LocationOperand(Offset jtocOffset)
jtocOffset
- JTOC offsetpublic LocationOperand(int index)
index
- spill offsetpublic LocationOperand()
public TypeReference getType()
Operand
TypeReference
of the value represented by the operand.getType
in class Operand
OptimizingCompilerException
public LocationOperand asFieldAccess()
public LocationOperand asArrayAccess()
public LocationOperand asJTOCAccess()
public LocationOperand asSpillAccess()
public LocationOperand asALengthAccess()
public LocationOperand asMethodAccess()
public FieldReference getFieldRef()
public TypeReference getElementType()
public Offset getJTOCoffset()
public int getOffset()
public boolean isFieldAccess()
public boolean isArrayAccess()
public boolean isJTOCAccess()
public boolean isSpillAccess()
public boolean isALengthAccess()
public boolean isMethodAccess()
public boolean mayBeVolatile()
true
if it's possible that the location is volatile,
false
if the location cannot possibly be volatilepublic Operand copy()
Operand
this
.private static boolean arrayMayBeAliased(TypeReference t1, TypeReference t2)
public static boolean mayBeAliased(LocationOperand op1, LocationOperand op2)
op1
- the first operandop2
- the second operandtrue
if the operands might be aliased or
false
if they are definitely not aliasedpublic boolean similar(Operand op)
Operand