diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 95614f21381..98bdc4b5487 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -3413,13 +3413,13 @@ js_StartRecorder(JSContext* cx, VMSideExit* anchor, Fragment* f, TreeInfo* ti, VMSideExit* expectedInnerExit, jsbytecode* outer, uint32 outerArgc) { JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx); - JS_ASSERT(f->root != f || !cx->fp->imacpc); - if (JS_TRACE_MONITOR(cx).needFlush) { FlushJITCache(cx); return false; } + JS_ASSERT(f->root != f || !cx->fp->imacpc); + /* start recording if no exception during construction */ tm->recorder = new (&gc) TraceRecorder(cx, anchor, f, ti, stackSlots, ngslots, typeMap, @@ -3776,7 +3776,11 @@ JS_REQUIRES_STACK static bool js_AttemptToStabilizeTree(JSContext* cx, VMSideExit* exit, jsbytecode* outer, uint32 outerArgc) { JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx); - JS_ASSERT(!tm->needFlush); + if (tm->needFlush) { + FlushJITCache(cx); + return false; + } + VMFragment* from = (VMFragment*)exit->from->root; TreeInfo* from_ti = (TreeInfo*)from->vmprivate; @@ -3883,7 +3887,12 @@ js_AttemptToStabilizeTree(JSContext* cx, VMSideExit* exit, jsbytecode* outer, ui static JS_REQUIRES_STACK bool js_AttemptToExtendTree(JSContext* cx, VMSideExit* anchor, VMSideExit* exitedFrom, jsbytecode* outer) { - JS_ASSERT(!JS_TRACE_MONITOR(cx).needFlush); + JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx); + if (tm->needFlush) { + FlushJITCache(cx); + return false; + } + Fragment* f = anchor->from->root; JS_ASSERT(f->vmprivate); TreeInfo* ti = (TreeInfo*)f->vmprivate;