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

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.operand.Operand
      extended by org.jikesrvm.compilers.opt.ir.operand.TypeOperand

public final class TypeOperand
extends Operand

A TypeOperand represents a type. Used in checkcast, instanceof, new, etc. It will contain either a RVMType (if the type can be resolved at compile time) or a TypeReference (if the type cannot be resolved at compile time).

See Also:
Operand, RVMType, TypeReference

Field Summary
private  RVMType type
          A type
private  TypeReference typeRef
          The data type.
 
Fields inherited from class org.jikesrvm.compilers.opt.ir.operand.Operand
instruction
 
Constructor Summary
  TypeOperand(RVMType typ)
          Create a new type operand with the specified type.
private TypeOperand(RVMType t, TypeReference tr)
           
  TypeOperand(TypeReference tr)
          Create a new type operand with the specified type reference
 
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.
 TypeReference getTypeRef()
           
 RVMType getVMType()
           
 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, isMovableObjectConstant, isNullConstant, isObjectConstant, isRef, 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

type

private final RVMType type
A type


typeRef

private final TypeReference typeRef
The data type.

Constructor Detail

TypeOperand

public TypeOperand(RVMType typ)
Create a new type operand with the specified type.


TypeOperand

public TypeOperand(TypeReference tr)
Create a new type operand with the specified type reference


TypeOperand

private TypeOperand(RVMType t,
                    TypeReference tr)
Method Detail

getType

public TypeReference getType()
Return the TypeReference of the value represented by the operand.

Overrides:
getType in class Operand
Returns:
TypeReference.Type

getTypeRef

public TypeReference getTypeRef()
Returns:
the TypeReference for this type operand

getVMType

public RVMType getVMType()
Returns:
the RVMType for this type operand -- may be null

copy

public Operand copy()
Return a new operand that is semantically equivalent to this.

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

similar

public boolean similar(Operand op)
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.