org.jikesrvm.compilers.opt.ir.operand
Class ObjectConstantOperand

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.operand.Operand
      extended by org.jikesrvm.compilers.opt.ir.operand.ConstantOperand
          extended by org.jikesrvm.compilers.opt.ir.operand.ObjectConstantOperand
Direct Known Subclasses:
ClassConstantOperand, StringConstantOperand

public class ObjectConstantOperand
extends ConstantOperand

Represents a constant object operand (for example, from an initialized static final).

See Also:
Operand

Field Summary
private  boolean movable
          Can this object be moved in memory?
 Offset offset
          Offset in JTOC where this object constant lives.
 Object value
          The non-null object value
 
Fields inherited from class org.jikesrvm.compilers.opt.ir.operand.Operand
instruction
 
Constructor Summary
ObjectConstantOperand(Object v, Offset i)
          Construct a new object constant operand
 
Method Summary
 Operand copy()
          Return a new operand that is semantically equivalent to this.
 TypeReference getType()
          Return the TypeReference of the value represented by the operand.
 boolean isMovableObjectConstant()
          Is the operand a movable ObjectConstantOperand?
 boolean isRef()
          Does the operand represent a value of the reference data type?
 boolean similar(Operand op)
          Are two operands semantically equivalent?
 String toString()
          Returns the string representation of this operand.
 
Methods inherited from class org.jikesrvm.compilers.opt.ir.operand.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, isNullConstant, isObjectConstant, isRegister, isStackLocation, isStringConstant, isTIBConstant, isTrueGuard, isType, meet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public final Object value
The non-null object value


offset

public final Offset offset
Offset in JTOC where this object constant lives.


movable

private final boolean movable
Can this object be moved in memory?

Constructor Detail

ObjectConstantOperand

public ObjectConstantOperand(Object v,
                             Offset i)
Construct a new object constant operand

Parameters:
v - the object constant
i - JTOC offset of the object constant
Method Detail

copy

public Operand copy()
Description copied from class: Operand
Return a new operand that is semantically equivalent to this.

Specified by:
copy in class Operand
Returns:
a copy of this

getType

public TypeReference getType()
Description copied from class: Operand
Return the TypeReference of the value represented by the operand.

Overrides:
getType in class Operand
Returns:
the type of the value represented by the operand

isRef

public final boolean isRef()
Description copied from class: Operand
Does the operand represent a value of the reference data type?

Overrides:
isRef in class Operand
Returns:
true if the data type of this is a reference as defined by TypeReference.isReferenceType() or false if it is not.

isMovableObjectConstant

public boolean isMovableObjectConstant()
Description copied from class: Operand
Is the operand a movable ObjectConstantOperand?

Overrides:
isMovableObjectConstant in class Operand
Returns:
movable

similar

public boolean similar(Operand op)
Description copied from class: Operand
Are two operands semantically equivalent?

Specified by:
similar in class Operand
Parameters:
op - other operand
Returns:
true if this and op are semantically equivalent or false if they are not.

toString

public String toString()
Returns the string representation of this operand.

Overrides:
toString in class Object
Returns:
a string representation of this operand.