code: public final void setMaximumInterpreterStackDepth(int max)
      {
          if(sealed) onSealedMutation();
          if(optimizationLevel != -1) {
              throw new IllegalStateException("Cannot set maximumInterpreterStackDepth when optimizationLevel != -1");
          }
          if(max < 1) {
              throw new IllegalArgumentException("Cannot set maximumInterpreterStackDepth to less than 1");
          }
          maximumInterpreterStackDepth = max;
      }
docs: Sets the maximum stack depth (in terms of number of call frames)
  allowed in a single invocation of interpreter. If the set depth would be
  exceeded, the interpreter will throw an EvaluatorException in the script.
  Defaults to Integer.MAX_VALUE. The setting only has effect for
  interpreted functions (those compiled with optimization level set to -1).
  As the interpreter doesn't use the Java stack but rather manages its own
  stack in the heap memory, a runaway recursion in interpreted code would
  eventually consume all available memory and cause OutOfMemoryError
  instead of a StackOverflowError limited to only a single thread. This
  setting helps prevent such situations.
  
  @param max the new maximum interpreter stack depth
  @throws IllegalStateException if this context's optimization level is not
  -1
  @throws IllegalArgumentException if the new depth is not at least 1