public abstract class Architecture extends Object
Modifier and Type | Field and Description |
---|---|
private ByteOrder |
byteOrder
The byte ordering can be either little or big endian.
|
private int |
implicitMemoryBarriers
Mask of the barrier constants denoting the barriers that are not required to be explicitly
inserted under this architecture.
|
private int |
machineCodeCallDisplacementOffset
Offset in bytes from the beginning of a call instruction to the displacement.
|
private String |
name
The name of this architecture (e.g.
|
private int |
registerReferenceMapSize
The number of entries required in a
ReferenceMap covering all the registers that may
store references. |
private Register[] |
registers
Array of all available registers on this architecture.
|
private int |
returnAddressSize
The size of the return address pushed to the stack by a call instruction.
|
private boolean |
unalignedMemoryAccess
Whether the architecture supports unaligned memory accesses.
|
private int |
wordSize
Represents the natural size of words (typically registers and pointers) of this architecture,
in bytes.
|
Modifier | Constructor and Description |
---|---|
protected |
Architecture(String name,
int wordSize,
ByteOrder byteOrder,
boolean unalignedMemoryAccess,
Register[] registers,
int implicitMemoryBarriers,
int nativeCallDisplacementOffset,
int registerReferenceMapSize,
int returnAddressSize) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canStoreValue(Register.RegisterCategory category,
PlatformKind kind)
Determine whether a kind can be stored in a register of a given category.
|
boolean |
equals(Object obj) |
ByteOrder |
getByteOrder() |
abstract PlatformKind |
getLargestStorableKind(Register.RegisterCategory category)
Return the largest kind that can be stored in a register of a given category.
|
int |
getMachineCodeCallDisplacementOffset()
Gets the offset in bytes from the beginning of a call instruction to the displacement.
|
String |
getName()
Gets the name of this architecture.
|
int |
getRegisterReferenceMapSize() |
Register[] |
getRegisters()
Gets an array of all available registers on this architecture.
|
int |
getReturnAddressSize()
Gets the size of the return address pushed to the stack by a call instruction.
|
int |
getSizeInBytes(PlatformKind kind)
Gets the size in bytes of the specified kind for this target.
|
int |
getWordSize()
Gets the natural size of words (typically registers and pointers) of this architecture, in
bytes.
|
int |
hashCode() |
int |
requiredBarriers(int barriers)
Determines the barriers in a given barrier mask that are explicitly required on this
architecture.
|
boolean |
supportsUnalignedMemoryAccess() |
String |
toString()
Converts this architecture to a string.
|
private final int registerReferenceMapSize
ReferenceMap
covering all the registers that may
store references. The index of a register in the reference map is given by
Register.getReferenceMapIndex()
.private final int wordSize
private final Register[] registers
private final boolean unalignedMemoryAccess
private final int implicitMemoryBarriers
private final int machineCodeCallDisplacementOffset
private final int returnAddressSize
protected Architecture(String name, int wordSize, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, int registerReferenceMapSize, int returnAddressSize)
public int getRegisterReferenceMapSize()
public int getWordSize()
public Register[] getRegisters()
public ByteOrder getByteOrder()
public boolean supportsUnalignedMemoryAccess()
public int getReturnAddressSize()
public int getMachineCodeCallDisplacementOffset()
public final int requiredBarriers(int barriers)
barriers
- a mask of the barrier constantsbarriers
minus the barriers unnecessary on this architecturepublic int getSizeInBytes(PlatformKind kind)
kind
- the kind for which to get the sizekind
public abstract boolean canStoreValue(Register.RegisterCategory category, PlatformKind kind)
category
- the category of the registerkind
- the kind that should be stored in the registerpublic abstract PlatformKind getLargestStorableKind(Register.RegisterCategory category)
category
- the category of the registercategory