public Frame subFrameForLabel(int startLabel, int subLabel) {
    LocalsArray subLocals = null;

    if (locals instanceof LocalsArraySet) {
      subLocals = ((LocalsArraySet) locals).subArrayForLabel(subLabel);
    }

    IntList newSubroutines;
    try {
      newSubroutines = subroutines.mutableCopy();

      if (newSubroutines.pop() != startLabel) {
        throw new RuntimeException("returning from invalid subroutine");
      }
      newSubroutines.setImmutable();
    } catch (IndexOutOfBoundsException ex) {
      throw new RuntimeException("returning from invalid subroutine");
    } catch (NullPointerException ex) {
      throw new NullPointerException("can't return from non-subroutine");
    }

    return (subLocals == null) ? null : new Frame(subLocals, stack, newSubroutines);
  }
Returns a Frame instance representing the frame state that should be used when returning from a
subroutine. The stack state of all subroutine invocations is identical, but the locals state
may differ.

@param startLabel {@code >=0;} The label of the returning subroutine's start block
@param subLabel {@code >=0;} A calling label of a subroutine
@return {@code null-ok;} an appropriatly-constructed instance, or null if label is not in the
    set
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/Frame.java