Class BasicRegisterMapper

java.lang.Object
com.android.dx.ssa.RegisterMapper
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 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 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