| Modifier and Type | Field and Description |
|---|---|
| protected final InterferenceGraph | interference
interference graph, indexed by register in both dimensions |
| protected final SsaMethod | ssaMeth
method being processed |
| Access | Constructor and Description |
|---|---|
| public | RegisterAllocator(SsaMethod
method to process. ssaMeth, InterferenceGraph Interference graph, indexed by register in both
dimensions. interference)Creates an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public abstract RegisterMapper | |
| protected final int | Returns: 1..2register reg)Returns the category (width) of the definition site of the register. |
| protected final RegisterSpec | Returns: definition spec of the register or null if it is never defined (for the case of "version 0" SSA registers)>= 0; SSA registerReturns the RegisterSpec of the definition of the register. |
| protected final RegisterSpec | Returns: non-null; spec of new SSA register created by movenon-null; insn to insert move before, must
be last insn in blocknon-null; SSA register to duplicateInserts a move instruction for a specified SSA register before a specified instruction, creating a new SSA register and adjusting the interference graph in the process. |
| protected boolean | Returns: true if this is a method parameterregister in question reg)Returns true if the definition site of this register is a move-param (ie, this is a method parameter). |
| public abstract boolean | Returns: true if params should be moved from low to highIndicates whether the method params were allocated at the bottom of the namespace, and thus should be moved up to the top of the namespace after phi removal. |
| interference | back to summary |
|---|---|
| protected final InterferenceGraph interference interference graph, indexed by register in both dimensions | |
| ssaMeth | back to summary |
|---|---|
| protected final SsaMethod ssaMeth method being processed | |
| RegisterAllocator | back to summary |
|---|---|
| public RegisterAllocator(SsaMethod ssaMeth, InterferenceGraph interference) Creates an instance. Call
| |
| allocateRegisters | back to summary |
|---|---|
| public abstract RegisterMapper allocateRegisters() Runs the algorithm.
| |
| getCategoryForSsaReg | back to summary |
|---|---|
| protected final int getCategoryForSsaReg(int reg) Returns the category (width) of the definition site of the register.
Returns
| |
| getDefinitionSpecForSsaReg | back to summary |
|---|---|
| protected final RegisterSpec getDefinitionSpecForSsaReg(int reg) Returns the RegisterSpec of the definition of the register.
| |
| insertMoveBefore | back to summary |
|---|---|
| protected final RegisterSpec insertMoveBefore(SsaInsn insn, RegisterSpec reg) Inserts a move instruction for a specified SSA register before a specified instruction, creating a new SSA register and adjusting the interference graph in the process. The insn currently must be the last insn in a block.
| |
| isDefinitionMoveParam | back to summary |
|---|---|
| protected boolean isDefinitionMoveParam(int reg) Returns true if the definition site of this register is a move-param (ie, this is a method parameter).
| |
| wantsParamsMovedHigh | back to summary |
|---|---|
| public abstract boolean wantsParamsMovedHigh() Indicates whether the method params were allocated at the bottom of the namespace, and thus should be moved up to the top of the namespace after phi removal.
| |