public int getRegistersSize() {
    int sz = size();
    int result = 0;

    for (int i = 0; i < sz; i++) {
      RegisterSpec spec = (RegisterSpec) get0(i);
      if (spec != null) {
        int min = spec.getNextReg();
        if (min > result) {
          result = min;
        }
      }
    }

    return result;
  }
Gets the minimum required register count implied by this instance. This is equal to the highest
register number referred to plus the widest width (largest category) of the type used in that
register.

@return {@code >= 0;} the required registers size
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/RegisterSpecList.java