public final RegisterSpecSet map(RegisterSpecSet sources) {
    int sz = sources.getMaxSize();
    RegisterSpecSet newSources = new RegisterSpecSet(getNewRegisterCount());

    for (int i = 0; i < sz; i++) {
      RegisterSpec registerSpec = sources.get(i);
      if (registerSpec != null) {
        newSources.put(map(registerSpec));
      }
    }

    newSources.setImmutable();

    // Return the old sources if nothing has changed.
    return newSources.equals(sources) ? sources : newSources;
  }
@param sources old register set
@return new mapped register set, or old if nothing has changed.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/RegisterMapper.java