private void mergeAndWorkAsNecessary(
      int label, int pred, Subroutine calledSubroutine, Frame frame, int[] workSet) {
    Frame existing = startFrames[label];
    Frame merged;

    if (existing != null) {
      /*
       * Some other block also continues at this label. Merge
       * the frames, and re-set the bit in the work set if there
       * was a change.
       */
      if (calledSubroutine != null) {
        merged = existing.mergeWithSubroutineCaller(frame, calledSubroutine.getStartBlock(), pred);
      } else {
        merged = existing.mergeWith(frame);
      }
      if (merged != existing) {
        startFrames[label] = merged;
        Bits.set(workSet, label);
      }
    } else {
      // This is the first time this label has been encountered.
      if (calledSubroutine != null) {
        startFrames[label] = frame.makeNewSubroutineStartFrame(label, pred);
      } else {
        startFrames[label] = frame;
      }
      Bits.set(workSet, label);
    }
  }
Helper for {@link #processBlock}, which merges frames and adds to the work set, as necessary.

@param label {@code >= 0;} label to work on
@param pred predecessor label; must be {@code >= 0} when {@code label} is a subroutine start
    block and calledSubroutine is non-null. Otherwise, may be -1.
@param calledSubroutine {@code null-ok;} a Subroutine instance if {@code label} is the first
    block in a subroutine.
@param frame {@code non-null;} new frame for the labelled block
@param workSet {@code non-null;} bits representing work to do, which this method may add to
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/Ropper.java