public final class Register extends Object implements Comparable<Register>
Modifier and Type | Class and Description |
---|---|
static class |
Register.RegisterCategory
A platform specific register type that describes which values can be stored in a register.
|
Modifier and Type | Field and Description |
---|---|
static Register |
CallerFrame |
int |
encoding
The actual encoding in a target machine instruction for this register, which may or may not
be the same as
number . |
static Register |
Frame
Frame pointer of the current method.
|
String |
name
The mnemonic of this register.
|
static Register |
None
Invalid register.
|
int |
number
The identifier for this register that is unique across all the registers in a
Architecture . |
private Register.RegisterCategory |
registerCategory
A platform specific register category that describes which values can be stored in a
register.
|
static Register.RegisterCategory |
SPECIAL |
Constructor and Description |
---|
Register(int number,
int encoding,
String name,
Register.RegisterCategory registerCategory)
Creates a
Register instance. |
Modifier and Type | Method and Description |
---|---|
RegisterValue |
asValue()
Gets this register as a value with no particular kind.
|
RegisterValue |
asValue(LIRKind kind)
Gets this register as a value with a specified kind.
|
int |
compareTo(Register o) |
int |
encoding()
The assembler calls this method to get the register's encoding.
|
boolean |
equals(Object obj) |
int |
getReferenceMapIndex()
Get the start index of this register in the
ReferenceMap . |
Register.RegisterCategory |
getRegisterCategory() |
int |
hashCode() |
boolean |
isValid()
Determines if this is a valid register.
|
static int |
maxRegisterEncoding(Register[] registers)
Gets the maximum register encoding in a given set of registers.
|
static int |
maxRegisterNumber(Register[] registers)
Gets the maximum register number in a given set of registers.
|
String |
toString() |
public static final Register.RegisterCategory SPECIAL
public static final Register Frame
public static final Register CallerFrame
public final int number
Architecture
. A valid register has number > 0
.public final int encoding
number
.private final Register.RegisterCategory registerCategory
public Register(int number, int encoding, String name, Register.RegisterCategory registerCategory)
Register
instance.number
- unique identifier for the registerencoding
- the target machine encoding for the registername
- the mnemonic name for the registerregisterCategory
- the register categorypublic int encoding()
public Register.RegisterCategory getRegisterCategory()
public int getReferenceMapIndex()
ReferenceMap
.public RegisterValue asValue(LIRKind kind)
kind
- the specified kindRegisterValue
public RegisterValue asValue()
RegisterValue
with Kind.Illegal
kind.public boolean isValid()
true
iff this register is validpublic static int maxRegisterNumber(Register[] registers)
registers
- the set of registers to processregisters
public static int maxRegisterEncoding(Register[] registers)
registers
- the set of registers to processregisters
public int compareTo(Register o)
compareTo
in interface Comparable<Register>