Diagnostic patch to debug intermittent assertion following bug 631135. r=debugging

--HG--
extra : rebase_source : e8fb8988765236ce92ca4a7477a54d9eb8070794
This commit is contained in:
Jeff Walden 2011-02-19 02:25:39 -08:00
parent f12065a1c0
commit 551d670628
2 changed files with 16 additions and 3 deletions

View File

@ -196,7 +196,7 @@ struct JSStackFrame
uint32 nactual, uint32 flags);
/* Used for SessionInvoke. */
inline void resetInvokeCallFrame();
inline void resetInvokeCallFrame(JSContext *cx);
/* Called by method-jit stubs and serve as a specification for jit-code. */
inline void initCallFrameCallerHalf(JSContext *cx, uint32 flags, void *ncode);

View File

@ -98,8 +98,21 @@ JSStackFrame::initCallFrame(JSContext *cx, JSObject &callee, JSFunction *fun,
}
inline void
JSStackFrame::resetInvokeCallFrame()
JSStackFrame::resetInvokeCallFrame(JSContext *cx)
{
#ifdef DEBUG
if (!hasCallObj() && scopeChain_ != calleeValue().toObject().getParent()) {
js_DumpValue(calleeValue());
if (JSObject *sc = scopeChain_)
js_DumpObject(sc);
else
fprintf(stderr, "scopeChain_ == NULL\n");
if (JSObject *par = calleeValue().toObject().getParent())
js_DumpObject(par);
else
fprintf(stderr, "parent == NULL\n");
}
#endif
/* Undo changes to frame made during execution; see initCallFrame */
if (hasArgsObj())
@ -598,7 +611,7 @@ InvokeSessionGuard::invoke(JSContext *cx) const
/* Clear any garbage left from the last Invoke. */
JSStackFrame *fp = frame_.fp();
fp->clearMissingArgs();
fp->resetInvokeCallFrame();
fp->resetInvokeCallFrame(cx);
SetValueRangeToUndefined(fp->slots(), script_->nfixed);
JSBool ok;