com.android.dx.ssa
Class InterferenceRegisterMapper

java.lang.Object
  extended by com.android.dx.ssa.RegisterMapper
      extended by com.android.dx.ssa.BasicRegisterMapper
          extended by com.android.dx.ssa.InterferenceRegisterMapper

public class InterferenceRegisterMapper
extends BasicRegisterMapper

A register mapper that keeps track of the accumulated interference information for the registers in the new namespace. Please note that this mapper requires that the old namespace does not have variable register widths/categories, and the new namespace does.


Constructor Summary
InterferenceRegisterMapper(InterferenceGraph oldRegInterference, int countOldRegisters)
          Constructs an instance
 
Method Summary
 void addMapping(int oldReg, int newReg, int category)
          Adds a mapping to the mapper.
 boolean areAnyPinned(RegisterSpecList oldSpecs, int newReg, int targetCategory)
          Checks to see if any of a set of old-namespace registers are pinned to the specified new-namespace reg + category.
 boolean interferes(int oldReg, int newReg, int category)
          Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.
 boolean interferes(RegisterSpec oldSpec, int newReg)
          Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.
 
Methods inherited from class com.android.dx.ssa.BasicRegisterMapper
getNewRegisterCount, map, oldToNew, toHuman
 
Methods inherited from class com.android.dx.ssa.RegisterMapper
map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterferenceRegisterMapper

public InterferenceRegisterMapper(InterferenceGraph oldRegInterference,
                                  int countOldRegisters)
Constructs an instance

Parameters:
countOldRegisters - number of registers in old namespace
Method Detail

addMapping

public void addMapping(int oldReg,
                       int newReg,
                       int category)
Adds a mapping to the mapper. If oldReg has already been mapped, overwrites previous mapping with new mapping.

Overrides:
addMapping in class BasicRegisterMapper
Parameters:
oldReg - >= 0; old register
newReg - >= 0; new register
category - 1..2; width of reg

interferes

public boolean interferes(int oldReg,
                          int newReg,
                          int category)
Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.

Parameters:
oldReg - old namespace register
newReg - new namespace register
category - category of old namespace register
Returns:
true if oldReg will interfere with newReg

interferes

public boolean interferes(RegisterSpec oldSpec,
                          int newReg)
Checks to see if old namespace reg oldReg interferes with what currently maps to newReg.

Parameters:
oldSpec - non-null; old namespace register
newReg - new namespace register
Returns:
true if oldReg will interfere with newReg

areAnyPinned

public boolean areAnyPinned(RegisterSpecList oldSpecs,
                            int newReg,
                            int targetCategory)
Checks to see if any of a set of old-namespace registers are pinned to the specified new-namespace reg + category. Takes into account the category of the old-namespace registers.

Parameters:
oldSpecs - non-null; set of old-namespace regs
newReg - >= 0; new-namespace register
targetCategory - 1..2; the number of adjacent new-namespace registers (starting at ropReg) to consider
Returns:
true if any of the old-namespace register have been mapped to the new-namespace register + category


Copyright © 2013. All Rights Reserved.