This might be helpful:
http://mxr.mozilla.org/mozilla-central/source/js/xpconnect/src/XPCJSRuntime.cpp#3440

I can't vouch 100% for its accuracy, but it's probably pretty close.

In general, dynamic stack checks (measuring the top of the stack at XPCOM
startup, and comparing it with the stack at the point of interest) seem
preferable to hard-coding number-of-recursive-calls, since it doesn't
depend on the size of stack frames, which may drift over time. We can't do
this for JS (see the comments surrounding the MXR link above), but I bet we
could for layout.

bholley

On Mon, May 2, 2016 at 9:51 AM, L. David Baron <dba...@dbaron.org> wrote:

> On Monday 2016-05-02 10:22 +0300, Henri Sivonen wrote:
> > In the days of Windows 95, recursive algorithms in layout used to
> > overrun the call stack on Windows unless the depth of the DOM tree was
> > limited. The HTML parser still enforces the limit, and people complain
> > about it from time to time. (Most of the time, the Web pages that hit
> > the limit are doing something wrong, but that's normal.)
> >
> > Does layout still use recursive algorithms that require a depth limit?
>
> Layout does still use recursive algorithms, but it's entirely
> possible the depth limit can be increased given our current OS
> support, and the current sizes of the structures on the stack during
> Reflow (e.g., nsHTMLReflowState, nsBlockReflowState).
>
> Do you happen to know what the main thread stack size is on the
> platforms that we run on?
>
> One risk of such a change:  I'm not sure how good breakpad is at
> reporting crashes that result from stack overflows.  At the very
> least, I've seen crashes on Android that look like stack overflows,
> but didn't actually have a stack in the crash report (bug 1269013).
>
> -David
>
> --
> 𝄞   L. David Baron                         http://dbaron.org/   𝄂
> 𝄢   Mozilla                          https://www.mozilla.org/   𝄂
>              Before I built a wall I'd ask to know
>              What I was walling in or walling out,
>              And to whom I was like to give offense.
>                - Robert Frost, Mending Wall (1914)
>
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to