public void addMapping(int oldReg, int newReg, int category) {
    if (oldReg >= oldToNew.size()) {
      // expand the array as necessary
      for (int i = oldReg - oldToNew.size(); i >= 0; i--) {
        oldToNew.add(-1);
      }
    }

    oldToNew.set(oldReg, newReg);

    if (runningCountNewRegisters < (newReg + category)) {
      runningCountNewRegisters = newReg + category;
    }
  }
Adds a mapping to the mapper. If oldReg has already been mapped, overwrites previous mapping
with new mapping.

@param oldReg {@code >= 0;} old register
@param newReg {@code >= 0;} new register
@param category {@code 1..2;} width of reg
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/BasicRegisterMapper.java