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

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.IntConstantOperand

public final class IntConstantOperand
extends ConstantOperand

Represents a constant int operand.

See Also:
Operand

Field Summary
 int value
          Value of this operand.
static IntConstantOperand zero
          Constant 0, can be copied as convenient
 
Fields inherited from class org.jikesrvm.compilers.opt.ir.operand.Operand
instruction
 
Constructor Summary
IntConstantOperand(int v)
          Constructs a new int constant operand with the specified value.
 
Method Summary
 Operand copy()
          Return a new operand that is semantically equivalent to this.
 boolean equals(Object o)
           
 TypeReference getType()
          Return the TypeReference of the value represented by the operand.
 int hashCode()
           
 boolean isInt()
          Does the operand represent a value of the int data type?
 boolean isIntLike()
          Does the operand represent a value of an int-like data type?
 int lower16()
          Return the lower 16 bits (as an int) of value
 int lower8()
          Return the lower 8 bits (as an int) of value
 boolean similar(Operand op)
          Are two operands semantically equivalent?
 String toString()
          Returns the string representation of this operand.
 int upper16()
          Return the upper 16 bits (as an int) of value
 int upper24()
          Return the upper 24 bits (as an int) of value
 
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, isIntConstant, isLocation, isLong, isLongConstant, isMemory, isMethod, isMovableObjectConstant, isNullConstant, isObjectConstant, isRef, isRegister, isStackLocation, isStringConstant, isTIBConstant, isTrueGuard, isType, meet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

zero

public static final IntConstantOperand zero
Constant 0, can be copied as convenient


value

public final int value
Value of this operand.

Constructor Detail

IntConstantOperand

public IntConstantOperand(int v)
Constructs a new int constant operand with the specified value. Type will be determined by value.

Parameters:
v - value
Method Detail

getType

public TypeReference getType()
Return the TypeReference of the value represented by the operand. For int constants we speculate on the type dependenent on the constant value.

Overrides:
getType in class Operand
Returns:
a speculation on the type of the value represented by the operand.

isIntLike

public boolean isIntLike()
Description copied from class: Operand
Does the operand represent a value of an int-like data type?

Overrides:
isIntLike in class Operand
Returns:
true

isInt

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

Overrides:
isInt in class Operand
Returns:
true

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

lower8

public int lower8()
Return the lower 8 bits (as an int) of value


lower16

public int lower16()
Return the lower 16 bits (as an int) of value


upper16

public int upper16()
Return the upper 16 bits (as an int) of value


upper24

public int upper24()
Return the upper 24 bits (as an int) of value


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.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

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

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