Bug 621068: don't run deadbeef assertion in case of deep bail, r=dvander
authorDavid Mandelin <dmandelin@mozilla.com>
Wed, 12 Jan 2011 18:46:17 -0800
changeset 60576 707130d68d1be2727c8d4112ca6cca617e120bd9
parent 60575 b93dcfdb15e18857d89e6c057a26d280a78f2335
child 60577 dff3fccf74072239cd76f23845221107b0940a23
push id18037
push usercleary@mozilla.com
push dateFri, 14 Jan 2011 17:42:55 +0000
treeherdermozilla-central@4e0501a0c5e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs621068
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 621068: don't run deadbeef assertion in case of deep bail, r=dvander
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -6507,18 +6507,23 @@ ScopeChainCheck(JSContext* cx, TreeFragm
         debug_only_print0(LC_TMTracer, "Blacklist: non-global at root of scope chain.\n");
         Blacklist((jsbytecode*) f->root->ip);
         return false;
     }
 
     return true;
 }
 
-static void
-LeaveTree(TraceMonitor *tm, TracerState&, VMSideExit* lr);
+enum LEAVE_TREE_STATUS {
+  NO_DEEP_BAIL = 0,
+  DEEP_BAILED = 1
+};
+
+static LEAVE_TREE_STATUS
+LeaveTree(TraceMonitor *tm, TracerState&, VMSideExit *lr);
 
 /* Return false if the interpreter should goto error. */
 static JS_REQUIRES_STACK bool
 ExecuteTree(JSContext* cx, TreeFragment* f, uintN& inlineCallCount,
             VMSideExit** innermostNestedGuardp, VMSideExit **lrp)
 {
 #ifdef MOZ_TRACEVIS
     TraceVisStateObj tvso(cx, S_EXECUTE);
@@ -6567,21 +6572,27 @@ ExecuteTree(JSContext* cx, TreeFragment*
     debug_only(int64 t0 = PRMJ_Now();)
 #ifdef MOZ_TRACEVIS
     VMSideExit* lr = (TraceVisStateObj(cx, S_NATIVE), ExecuteTrace(cx, f, state));
 #else
     VMSideExit* lr = ExecuteTrace(cx, f, state);
 #endif
     debug_only(int64 t1 = PRMJ_Now();)
 
-    JS_ASSERT(*(uint64*)&tm->storage->global()[globalSlots] == 0xdeadbeefdeadbeefLL);
     JS_ASSERT_IF(lr->exitType == LOOP_EXIT, !lr->calldepth);
 
     /* Restore interpreter state. */
-    LeaveTree(tm, state, lr);
+#ifdef DEBUG
+    LEAVE_TREE_STATUS lts = 
+#endif
+        LeaveTree(tm, state, lr);
+#ifdef DEBUG
+    JS_ASSERT_IF(lts == NO_DEEP_BAIL,
+                 *(uint64*)&tm->storage->global()[globalSlots] == 0xdeadbeefdeadbeefLL);
+#endif
 
     *lrp = state.innermost;
     bool ok = !(state.builtinStatus & BUILTIN_ERROR);
     JS_ASSERT_IF(cx->isExceptionPending(), !ok);
 
     size_t iters = tm->iterationCounter;
 
     f->execs++;
@@ -6626,17 +6637,17 @@ public:
     }
 
     ~Guardian() {
         JS_ASSERT(*flagp);
         *flagp = false;
     }
 };
 
-static JS_FORCES_STACK void
+static JS_FORCES_STACK LEAVE_TREE_STATUS
 LeaveTree(TraceMonitor *tm, TracerState& state, VMSideExit* lr)
 {
     VOUCH_DOES_NOT_REQUIRE_STACK();
 
     JSContext* cx = state.cx;
 
     /* Temporary waive the soft GC quota to make sure LeaveTree() doesn't fail. */
     Guardian waiver(&JS_THREAD_DATA(cx)->waiveGCQuota);
@@ -6771,17 +6782,17 @@ LeaveTree(TraceMonitor *tm, TracerState&
             for (int i = 1; i <= cs.ndefs; i++) {
                 NativeToValue(cx,
                               regs->sp[-i],
                               typeMap[innermost->numStackSlots - i],
                               (jsdouble *) state.deepBailSp
                               + innermost->sp_adj / sizeof(jsdouble) - i);
             }
         }
-        return;
+        return DEEP_BAILED;
     }
 
     while (callstack < rp) {
         FrameInfo* fi = *callstack;
         /* Peek at the callee native slot in the not-yet-synthesized prev frame. */
         JSObject* callee = *(JSObject**)&stack[fi->callerHeight];
 
         /*
@@ -6951,16 +6962,17 @@ LeaveTree(TraceMonitor *tm, TracerState&
 #ifdef JS_JIT_SPEW
     if (innermost->exitType != TIMEOUT_EXIT)
         AUDIT(sideExitIntoInterpreter);
     else
         AUDIT(timeoutIntoInterpreter);
 #endif
 
     state.innermost = innermost;
+    return NO_DEEP_BAIL;
 }
 
 static jsbytecode *
 GetLoopBottom(JSContext *cx, jsbytecode *pc)
 {
     JS_ASSERT(*pc == JSOP_TRACE || *pc == JSOP_NOTRACE);
     JSScript *script = cx->fp()->script();
     jssrcnote *sn = js_GetSrcNote(script, pc);