Bug 766805 - Backout (orange)
authorSean Stangl <sstangl@mozilla.com>
Mon, 25 Jun 2012 13:54:43 -0700
changeset 106458 d85ca085f35d180135e7e3d556c872eba499691f
parent 106457 73e8ca73e5bd0cf7e081589853f835b487066437
child 106459 8862e62cd1f5212b4a71b51d0a5bc75e115184b2
push id23447
push userdanderson@mozilla.com
push dateTue, 11 Sep 2012 17:34:27 +0000
treeherdermozilla-central@fdfaef738a00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs766805
milestone16.0a1
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 766805 - Backout (orange)
js/src/vm/Stack.cpp
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -820,92 +820,76 @@ ContextStack::containsSlow(const StackFr
     for (StackSegment *s = seg_; s; s = s->prevInContext()) {
         if (s->contains(target))
             return true;
     }
     return false;
 }
 
 /*
- * The only calls made by inlined methodjit frames can be to other JIT
- * frames associated with the same VMFrame. If we try to Invoke(),
- * Execute() or so forth, any topmost inline frame will need to be
- * expanded (along with other inline frames in the compartment).
- * To avoid pathological behavior here, make sure to mark any topmost
- * function as uninlineable, which will expand inline frames if there are
- * any and prevent the function from being inlined in the future.
- *
- * Note: When called from pushBailoutFrame, error = DONT_REPORT_ERROR. Use
- * this to deny potential invalidation, which would read from
- * runtime->ionTop.
- */
-static void
-MarkJaegerUninlineable(JSContext *cx, MaybeReportError report)
-{
-    FrameRegs *regs = cx->maybeRegs();
-    JS_ASSERT_IF(cx->hasfp(), !cx->regs().inlined());
-
-    if (!regs || report == DONT_REPORT_ERROR)
-        return;
-
-    JSFunction *fun = NULL;
-
-    if (InlinedSite *site = regs->inlined()) {
-        mjit::JITChunk *chunk = regs->fp()->jit()->chunk(regs->pc);
-        fun = chunk->inlineFrames()[site->inlineIndex].fun;
-    } else {
-        StackFrame *fp = regs->fp();
-        if (fp->isFunctionFrame()) {
-            JSFunction *f = fp->fun();
-            if (f->isInterpreted())
-                fun = f;
-        }
-    }
-
-    if (fun) {
-        fun->script()->uninlineable = true;
-        types::MarkTypeObjectFlags(cx, fun, types::OBJECT_FLAG_UNINLINEABLE);
-    }
-}
-
-/*
  * This helper function brings the ContextStack to the top of the thread stack
  * (so that it can be extended to push a frame and/or arguments) by potentially
  * pushing a StackSegment. The 'pushedSeg' outparam indicates whether such a
  * segment was pushed (and hence whether the caller needs to call popSegment).
  *
  * Additionally, to minimize calls to ensureSpace, ensureOnTop ensures that
  * there is space for nvars slots on top of the stack.
  */
 Value *
 ContextStack::ensureOnTop(JSContext *cx, MaybeReportError report, unsigned nvars,
                           MaybeExtend extend, bool *pushedSeg, JSCompartment *dest)
 {
     Value *firstUnused = space().firstUnused();
+    FrameRegs *regs = cx->maybeRegs();
 
 #ifdef JS_METHODJIT
-# ifdef JS_ION
-    // Don't mark uninlineable if called from invokeFunction().
-    if (!cx->runtime->ionTop)
-# endif
-    {
-        MarkJaegerUninlineable(cx, report);
+    /*
+     * The only calls made by inlined methodjit frames can be to other JIT
+     * frames associated with the same VMFrame. If we try to Invoke(),
+     * Execute() or so forth, any topmost inline frame will need to be
+     * expanded (along with other inline frames in the compartment).
+     * To avoid pathological behavior here, make sure to mark any topmost
+     * function as uninlineable, which will expand inline frames if there are
+     * any and prevent the function from being inlined in the future.
+     *
+     * Note: When called from pushBailoutFrame, error = DONT_REPORT_ERROR. Use
+     * this to deny potential invalidation, which would read from
+     * runtime->ionTop.
+     */
+    if (regs && report != DONT_REPORT_ERROR) {
+        JSFunction *fun = NULL;
+        if (InlinedSite *site = regs->inlined()) {
+            mjit::JITChunk *chunk = regs->fp()->jit()->chunk(regs->pc);
+            fun = chunk->inlineFrames()[site->inlineIndex].fun;
+        } else {
+            StackFrame *fp = regs->fp();
+            if (fp->isFunctionFrame()) {
+                JSFunction *f = fp->fun();
+                if (f->isInterpreted())
+                    fun = f;
+            }
+        }
+
+        if (fun) {
+            fun->script()->uninlineable = true;
+            types::MarkTypeObjectFlags(cx, fun, types::OBJECT_FLAG_UNINLINEABLE);
+        }
     }
+    JS_ASSERT_IF(cx->hasfp(), !cx->regs().inlined());
 #endif
 
     if (onTop() && extend) {
         if (!space().ensureSpace(cx, report, firstUnused, nvars, dest))
             return NULL;
         return firstUnused;
     }
 
     if (!space().ensureSpace(cx, report, firstUnused, VALUES_PER_STACK_SEGMENT + nvars, dest))
         return NULL;
 
-    FrameRegs *regs;
     CallArgsList *calls;
     if (seg_ && extend) {
         regs = seg_->maybeRegs();
         calls = seg_->maybeCalls();
     } else {
         regs = NULL;
         calls = NULL;
     }