com.android.dx.ssa
Class BasicRegisterMapper

java.lang.Object
  extended by com.android.dx.ssa.RegisterMapper
      extended by com.android.dx.ssa.BasicRegisterMapper
Direct Known Subclasses:
InterferenceRegisterMapper

public class BasicRegisterMapper
extends RegisterMapper

This class maps one register space into another, with each mapping built up individually and added via addMapping()


Constructor Summary
BasicRegisterMapper(int countOldRegisters)
          Creates a new OneToOneRegisterMapper.
 
Method Summary
 void addMapping(int oldReg, int newReg, int category)
          Adds a mapping to the mapper.
 int getNewRegisterCount()
          Gets the count of registers (really, the total register width, since category width is counted) in the new namespace.
 RegisterSpec map(RegisterSpec registerSpec)
          
 int oldToNew(int oldReg)
          Returns the new-namespace mapping for the specified old-namespace register, or -1 if one exists.
 String toHuman()
          
 
Methods inherited from class com.android.dx.ssa.RegisterMapper
map, map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicRegisterMapper

public BasicRegisterMapper(int countOldRegisters)
Creates a new OneToOneRegisterMapper.

Parameters:
countOldRegisters - the number of registers in the old name space
Method Detail

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 class RegisterMapper
Returns:
>= 0 width of new namespace.

map

public RegisterSpec map(RegisterSpec registerSpec)

Specified by:
map in class RegisterMapper
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

public String 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 register
newReg - >= 0; new register
category - 1..2; width of reg


Copyright © 2015. All rights reserved.