public abstract class RegisterAllocator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected InterferenceGraph |
interference
interference graph, indexed by register in both dimensions
|
protected SsaMethod |
ssaMeth
method being processed
|
| Constructor and Description |
|---|
RegisterAllocator(SsaMethod ssaMeth,
InterferenceGraph interference)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
abstract RegisterMapper |
allocateRegisters()
Runs the algorithm.
|
protected int |
getCategoryForSsaReg(int reg)
Returns the category (width) of the definition site of the register.
|
protected RegisterSpec |
getDefinitionSpecForSsaReg(int reg)
Returns the RegisterSpec of the definition of the register.
|
protected 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.
|
protected boolean |
isDefinitionMoveParam(int reg)
Returns true if the definition site of this register is a
move-param (ie, this is a method parameter).
|
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.
|
protected final SsaMethod ssaMeth
protected final InterferenceGraph interference
public RegisterAllocator(SsaMethod ssaMeth, InterferenceGraph interference)
allocateRegisters to run.ssaMeth - method to process.interference - Interference graph, indexed by register in both
dimensions.public abstract boolean wantsParamsMovedHigh()
true if params should be moved from low to highpublic abstract RegisterMapper allocateRegisters()
SsaMethodprotected final int getCategoryForSsaReg(int reg)
1 for undefined registers.reg - register1..2protected final RegisterSpec getDefinitionSpecForSsaReg(int reg)
reg - >= 0; SSA registerprotected boolean isDefinitionMoveParam(int reg)
reg - register in questiontrue if this is a method parameterprotected final RegisterSpec insertMoveBefore(SsaInsn insn, RegisterSpec reg)
insn - non-null; insn to insert move before, must
be last insn in blockreg - non-null; SSA register to duplicatenon-null; spec of new SSA register created by moveCopyright © 2020. All Rights Reserved.