Package com.android.dx.ssa
Class BasicRegisterMapper
java.lang.Object
com.android.dx.ssa.RegisterMapper
com.android.dx.ssa.BasicRegisterMapper
- Direct Known Subclasses:
InterferenceRegisterMapper
This class maps one register space into another, with
each mapping built up individually and added via addMapping()
-
Constructor Summary
ConstructorDescriptionBasicRegisterMapper
(int countOldRegisters) Creates a new OneToOneRegisterMapper. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapping
(int oldReg, int newReg, int category) Adds a mapping to the mapper.int
Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.map
(RegisterSpec registerSpec) int
oldToNew
(int oldReg) Returns the new-namespace mapping for the specified old-namespace register, or -1 if one exists.toHuman()
Methods inherited from class com.android.dx.ssa.RegisterMapper
map, map
-
Constructor Details
-
BasicRegisterMapper
public BasicRegisterMapper(int countOldRegisters) Creates a new OneToOneRegisterMapper.- Parameters:
countOldRegisters
- the number of registers in the old name space
-
-
Method Details
-
getNewRegisterCount
public int getNewRegisterCount()Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.- Specified by:
getNewRegisterCount
in classRegisterMapper
- Returns:
- ≥ 0 width of new namespace.
-
map
- Specified by:
map
in classRegisterMapper
- Parameters:
registerSpec
- old register- Returns:
- register in new space
-
oldToNew
public int oldToNew(int oldReg) Returns the new-namespace mapping for the specified old-namespace register, or -1 if one exists.- Parameters:
oldReg
->= 0;
old-namespace register- Returns:
- new-namespace register or -1 if none
-
toHuman
-
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.- Parameters:
oldReg
->= 0;
old registernewReg
->= 0;
new registercategory
-1..2;
width of reg
-