V8Proxy::didLeaveScriptContext claims to run whenever the outermost script invocation exits, but it's broken in two ways:
- Not all script calls go through V8Proxy::callFunction (e.g., they call the v8::Function::Call, or V8Proxy::instrumentedCallFunction).
- V8Proxy::m_recursion (used to count the number of nested invocations) is per-frame, which is incorrect. It should probably just be a static.
So we need a replacement for m_recursion and didLeaveScriptContext. Where these live is up in the air (abarth suggests that V8Proxy is not the right place to live).
Per :dslomov, m_recursion should live in V8BindingPerIsolateData.
Created attachment 117062 [details]
Note that this patch has the effect that old callers of callFunctionWithoutFrame now also check the max recursion depth, and invoke didLeaveScriptContext. Existing callers of instrumentedCallFunction get both of these PLUS (at no added cost) the V8GCController::checkMemoryUsage().
Comment on attachment 117062 [details]
Clearing flags on attachment: 117062
Committed r101490: <http://trac.webkit.org/changeset/101490>
All reviewed patches have been landed. Closing bug.