Bug 910782 - SpiderMonkey: Add an explicit scope aroud the InvokeState object's lifetime. r=luke
authorDan Gohman <sunfish@google.com>
Wed, 04 Sep 2013 20:06:07 -0700
changeset 158534 bf286f1d5489d2b2985cccfbf32f917124058e2f
parent 158533 0e876da27431beceee6027b3cc4ece46086189b0
child 158535 4537337759b73a894a7c6b4c1d4b2b1d4d68010d
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs910782
milestone26.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 910782 - SpiderMonkey: Add an explicit scope aroud the InvokeState object's lifetime. r=luke
js/src/vm/Interpreter.cpp
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -2467,43 +2467,45 @@ BEGIN_CASE(JSOP_FUNCALL)
     }
 
     InitialFrameFlags initial = construct ? INITIAL_CONSTRUCT : INITIAL_NONE;
     bool newType = cx->typeInferenceEnabled() && UseNewType(cx, script, regs.pc);
 
     TypeMonitorCall(cx, args, construct);
 
 #ifdef JS_ION
-    InvokeState state(cx, args, initial);
-    if (newType)
-        state.setUseNewType();
-
-    if (!newType && jit::IsIonEnabled(cx)) {
-        jit::MethodStatus status = jit::CanEnter(cx, state);
-        if (status == jit::Method_Error)
-            goto error;
-        if (status == jit::Method_Compiled) {
-            jit::IonExecStatus exec = jit::Cannon(cx, state);
-            CHECK_BRANCH();
-            regs.sp = args.spAfterCall();
-            interpReturnOK = !IsErrorStatus(exec);
-            goto jit_return;
+    {
+        InvokeState state(cx, args, initial);
+        if (newType)
+            state.setUseNewType();
+
+        if (!newType && jit::IsIonEnabled(cx)) {
+            jit::MethodStatus status = jit::CanEnter(cx, state);
+            if (status == jit::Method_Error)
+                goto error;
+            if (status == jit::Method_Compiled) {
+                jit::IonExecStatus exec = jit::Cannon(cx, state);
+                CHECK_BRANCH();
+                regs.sp = args.spAfterCall();
+                interpReturnOK = !IsErrorStatus(exec);
+                goto jit_return;
+            }
         }
-    }
-
-    if (jit::IsBaselineEnabled(cx)) {
-        jit::MethodStatus status = jit::CanEnterBaselineMethod(cx, state);
-        if (status == jit::Method_Error)
-            goto error;
-        if (status == jit::Method_Compiled) {
-            jit::IonExecStatus exec = jit::EnterBaselineMethod(cx, state);
-            CHECK_BRANCH();
-            regs.sp = args.spAfterCall();
-            interpReturnOK = !IsErrorStatus(exec);
-            goto jit_return;
+
+        if (jit::IsBaselineEnabled(cx)) {
+            jit::MethodStatus status = jit::CanEnterBaselineMethod(cx, state);
+            if (status == jit::Method_Error)
+                goto error;
+            if (status == jit::Method_Compiled) {
+                jit::IonExecStatus exec = jit::EnterBaselineMethod(cx, state);
+                CHECK_BRANCH();
+                regs.sp = args.spAfterCall();
+                interpReturnOK = !IsErrorStatus(exec);
+                goto jit_return;
+            }
         }
     }
 #endif
 
     funScript = fun->nonLazyScript();
     if (!activation.pushInlineFrame(args, funScript, initial))
         goto error;