1 /* globals stackPointerInfo */
3 var stackBottom = stackPointerInfo();
4 var stackTop = stackBottom;
6 function nearNativeStackLimit() {
9 stackTop = stackPointerInfo();
10 // eslint-disable-next-line no-eval
11 var stepsFromLimit = eval("inner()"); // Use eval to force a number of native stackframes to be created.
12 return stepsFromLimit + 1;
14 // It would be nice to check here that the exception is actually an
15 // over-recursion here. But doing so would require toString()ing the
16 // exception, which we may not have the stack space to do.
23 var nbFrames = nearNativeStackLimit();
24 var frameSize = stackBottom - stackTop;
29 "\nMaximum number of frames:",
31 "\nAverage frame size:",
32 Math.ceil(frameSize / nbFrames),