public final class RegisterSaveLayout extends Object
Modifier and Type | Field and Description |
---|---|
private Register[] |
registers
Keys.
|
private int[] |
slots
Slot indexes relative to stack pointer.
|
Constructor and Description |
---|
RegisterSaveLayout(Register[] registers,
int[] slots)
Creates a map from registers to frame slots.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
Map<Register,Integer> |
registersToSlots(boolean sorted)
Gets this layout information as a
Map from registers to slots. |
int |
registerToSlot(Register register)
Gets the frame slot index for a given register.
|
Map<Integer,Register> |
slotsToRegisters(boolean sorted)
Gets this layout information as a
Map from slots to registers. |
String |
toString() |
private final int[] slots
public RegisterSaveLayout(Register[] registers, int[] slots)
registers
- the keys in the mapslots
- frame slot index for each register in registers
public int registerToSlot(Register register)
register
- register to get the frame slot index forpublic Map<Register,Integer> registersToSlots(boolean sorted)
Map
from registers to slots.public Map<Integer,Register> slotsToRegisters(boolean sorted)
Map
from slots to registers.