public int getRegCount() {
    if (regCount == -1) {
      RegCountVisitor visitor = new RegCountVisitor();
      forEachInsn(visitor);
      regCount = visitor.getRegCount();
    }

    return regCount;
  }
Returns how many registers this method requires. This is simply the maximum of
register-number-plus-category referred to by this instance's instructions (indirectly through
{@link BasicBlock} instances).

@return {@code >= 0;} the register count
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/BasicBlockList.java