Diagnostic patch to debug intermittent assertion following bug 631135. r=debugging
☠☠ backed out by 8c14f73ca5ae ☠ ☠
authorJeff Walden <jwalden@mit.edu>
Sat, 19 Feb 2011 02:25:39 -0800
changeset 62951 4d86e63ff60d40f4c39a1c7d1d880b77d61f9565
parent 62950 4e085ba15d4c6bcd2020e6ba7cf3cda491bcc5eb
child 62952 1a8670f6d41ebbd75d2f986eb9dd3e552248d6ea
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersdebugging
bugs631135
milestone2.0b12pre
Diagnostic patch to debug intermittent assertion following bug 631135. r=debugging
js/src/jsinterp.h
js/src/jsinterpinlines.h
--- a/js/src/jsinterp.h
+++ b/js/src/jsinterp.h
@@ -191,17 +191,17 @@ struct JSStackFrame
      * simpler reasoning and makes call-optimization easier.
      */
 
     /* Used for Invoke, Interpret, trace-jit LeaveTree, and method-jit stubs. */
     inline void initCallFrame(JSContext *cx, JSObject &callee, JSFunction *fun,
                               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);
     inline void initCallFrameEarlyPrologue(JSFunction *fun, uint32 nactual);
     inline void initCallFrameLatePrologue();
 
     /* Used for eval. */
     inline void initEvalFrame(JSContext *cx, JSScript *script, JSStackFrame *prev,
--- a/js/src/jsinterpinlines.h
+++ b/js/src/jsinterpinlines.h
@@ -93,18 +93,31 @@ JSStackFrame::initCallFrame(JSContext *c
     JS_ASSERT(!hasImacropc());
     JS_ASSERT(!hasHookData());
     JS_ASSERT(annotation() == NULL);
 
     JS_ASSERT(!hasCallObj());
 }
 
 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())
         args.nactual = argsObj().getArgsInitialLength();
 
     JS_ASSERT(!(flags_ & ~(JSFRAME_FUNCTION |
                            JSFRAME_OVERFLOW_ARGS |
                            JSFRAME_UNDERFLOW_ARGS |
@@ -593,17 +606,17 @@ InvokeSessionGuard::invoke(JSContext *cx
 #else
     if (!optimized())
 #endif
         return Invoke(cx, args_, 0);
 
     /* 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;
     {
         AutoPreserveEnumerators preserve(cx);
         Probes::enterJSFun(cx, fp->fun(), script_);
 #ifdef JS_METHODJIT
         AutoInterpPreparer prepareInterp(cx, script_);