From 8cc5c13b9cb3f564ebc531da2ffc36a60f41a7fb Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Tue, 12 May 2009 16:42:21 -0700 Subject: [PATCH] Don't try to compile more code once we are in a needFlush state (492664, r=dmandelin). --- js/src/jstracer.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 95614f213816..98bdc4b5487d 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;