public static void popFramesUpTo(ControlFrame frame) {
    if (frame.down != null) {
      ControlFrame.popFramesUpTo(frame.down);
    }
    if (frame.up != null) {
      frame.up.down = null;
    }
    ControlFrame.popControlFrame(frame);
  }