com.android.dx.ssa.back
Class FirstFitLocalCombiningAllocator

java.lang.Object
  extended by com.android.dx.ssa.back.RegisterAllocator
      extended by com.android.dx.ssa.back.FirstFitLocalCombiningAllocator

public class FirstFitLocalCombiningAllocator
extends RegisterAllocator

Allocates registers in a first-fit fashion, with the bottom reserved for method parameters and all SSAregisters representing the same local variable kept together if possible.


Field Summary
 
Fields inherited from class com.android.dx.ssa.back.RegisterAllocator
interference, ssaMeth
 
Constructor Summary
FirstFitLocalCombiningAllocator(SsaMethod ssaMeth, InterferenceGraph interference, boolean minimizeRegisters)
          Constructs instance.
 
Method Summary
 RegisterMapper allocateRegisters()
          Runs the algorithm.
 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 com.android.dx.ssa.back.RegisterAllocator
getCategoryForSsaReg, getDefinitionSpecForSsaReg, insertMoveBefore, isDefinitionMoveParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstFitLocalCombiningAllocator

public FirstFitLocalCombiningAllocator(SsaMethod ssaMeth,
                                       InterferenceGraph interference,
                                       boolean minimizeRegisters)
Constructs instance.

Parameters:
ssaMeth - non-null; method to process
interference - non-null interference graph for SSA registers
minimizeRegisters - true if converter should take steps to minimize rop-form registers
Method Detail

wantsParamsMovedHigh

public 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.

Specified by:
wantsParamsMovedHigh in class RegisterAllocator
Returns:
true if params should be moved from low to high

allocateRegisters

public RegisterMapper allocateRegisters()
Runs the algorithm.

Specified by:
allocateRegisters in class RegisterAllocator
Returns:
a register mapper to apply to the SsaMethod


Copyright © 2015. All rights reserved.