@Override
 protected void popFromFrame(ExecutionStackFrame frame) {
   if (currentFrame.invocationDepth == 0) {
     frames.remove(frames.size() - 1);
     if (frames.isEmpty()) {
       currentFrame = null;
       ExecutionPath.removeExecutionContext(Key.INSTANCE);
     } else {
       currentFrame = frames.get(frames.size() - 1);
     }
   } else {
     currentFrame.invocationDepth--;
   }
 }
    void changeMode(Mode newMode) {
      if (currentFrame == null) {
        if (newMode == DEFAULT_MODE) {
          return;
        }

        ExecutionPath.installExecutionContext(Key.INSTANCE, this);
      } else {
        if (currentFrame.mode == newMode) {
          return;
        }

        if (currentFrame.invocationDepth == 0) {
          currentFrame.mode = newMode;
          return;
        }
      }

      Frame frame = new Frame(newMode);
      frames.add(frame);
      currentFrame = frame;
    }