|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.ssa.back.RegisterAllocator
public abstract class RegisterAllocator
Base class of all register allocators.
| Field Summary | |
|---|---|
protected InterferenceGraph |
interference
interference graph, indexed by register in both dimensions |
protected SsaMethod |
ssaMeth
method being processed |
| Constructor Summary | |
|---|---|
RegisterAllocator(SsaMethod ssaMeth,
InterferenceGraph interference)
Creates an instance. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final SsaMethod ssaMeth
protected final InterferenceGraph interference
| Constructor Detail |
|---|
public RegisterAllocator(SsaMethod ssaMeth,
InterferenceGraph interference)
allocateRegisters to run.
ssaMeth - method to process.interference - Interference graph, indexed by register in both
dimensions.| Method Detail |
|---|
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 - register
1..2protected final RegisterSpec getDefinitionSpecForSsaReg(int reg)
reg - >= 0; SSA register
protected boolean isDefinitionMoveParam(int reg)
reg - register in question
true if this is a method parameter
protected 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 duplicate
non-null; spec of new SSA register created by move
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||