Package com.android.dx.ssa
Class InterferenceRegisterMapper
java.lang.Object
com.android.dx.ssa.RegisterMapper
com.android.dx.ssa.BasicRegisterMapper
com.android.dx.ssa.InterferenceRegisterMapper
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
ConstructorDescriptionInterferenceRegisterMapper
(InterferenceGraph oldRegInterference, int countOldRegisters) Constructs an instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 regoldReg
interferes with what currently maps tonewReg
.boolean
interferes
(RegisterSpec oldSpec, int newReg) Checks to see if old namespace regoldReg
interferes with what currently maps tonewReg
.Methods inherited from class com.android.dx.ssa.BasicRegisterMapper
getNewRegisterCount, map, oldToNew, toHuman
Methods inherited from class com.android.dx.ssa.RegisterMapper
map, map
-
Constructor Details
-
InterferenceRegisterMapper
Constructs an instance- Parameters:
countOldRegisters
- number of registers in old namespace
-
-
Method Details
-
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 classBasicRegisterMapper
- Parameters:
oldReg
->= 0;
old registernewReg
->= 0;
new registercategory
-1..2;
width of reg
-
interferes
public boolean interferes(int oldReg, int newReg, int category) Checks to see if old namespace regoldReg
interferes with what currently maps tonewReg
.- Parameters:
oldReg
- old namespace registernewReg
- new namespace registercategory
- category of old namespace register- Returns:
- true if oldReg will interfere with newReg
-
interferes
Checks to see if old namespace regoldReg
interferes with what currently maps tonewReg
.- Parameters:
oldSpec
-non-null;
old namespace registernewReg
- new namespace register- Returns:
- true if oldReg will interfere with newReg
-
areAnyPinned
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 regsnewReg
->= 0;
new-namespace registertargetCategory
-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
-