Bug 1406957 part 1 - Remove Maybe<InvokeState> in Interpret. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 11 Oct 2017 14:53:10 +0200
changeset 385552 d2e30f1d6cf51547866b133ac9c35948b810736e
parent 385551 18b0835d80c008625f93086f35d2ceace707deac
child 385553 817d7ec24cb64275dd3c31ed29307c85407d8acb
push id32662
push userryanvm@gmail.com
push dateWed, 11 Oct 2017 21:53:47 +0000
treeherdermozilla-central@3d918ff5d634 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1406957
milestone58.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 1406957 part 1 - Remove Maybe<InvokeState> in Interpret. r=tcampbell
js/src/vm/Interpreter.cpp
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -3096,51 +3096,51 @@ CASE(JSOP_FUNCALL)
         ReservedRooted<JSScript*> funScript(&rootScript0, JSFunction::getOrCreateScript(cx, fun));
         if (!funScript)
             goto error;
 
         bool createSingleton = ObjectGroup::useSingletonForNewObject(cx, script, REGS.pc);
 
         TypeMonitorCall(cx, args, construct);
 
-        mozilla::Maybe<InvokeState> state;
-        state.emplace(cx, args, construct);
-
-        if (createSingleton)
-            state->setCreateSingleton();
-
-        if (!createSingleton && jit::IsIonEnabled(cx)) {
-            jit::MethodStatus status = jit::CanEnter(cx, state.ref());
-            if (status == jit::Method_Error)
-                goto error;
-            if (status == jit::Method_Compiled) {
-                jit::JitExecStatus exec = jit::IonCannon(cx, state.ref());
-                interpReturnOK = !IsErrorStatus(exec);
-                if (interpReturnOK)
-                    CHECK_BRANCH();
-                REGS.sp = args.spAfterCall();
-                goto jit_return;
+        {
+            InvokeState state(cx, args, construct);
+
+            if (createSingleton)
+                state.setCreateSingleton();
+
+            if (!createSingleton && jit::IsIonEnabled(cx)) {
+                jit::MethodStatus status = jit::CanEnter(cx, state);
+                if (status == jit::Method_Error)
+                    goto error;
+                if (status == jit::Method_Compiled) {
+                    jit::JitExecStatus exec = jit::IonCannon(cx, state);
+                    interpReturnOK = !IsErrorStatus(exec);
+                    if (interpReturnOK)
+                        CHECK_BRANCH();
+                    REGS.sp = args.spAfterCall();
+                    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::JitExecStatus exec = jit::EnterBaselineMethod(cx, state);
+                    interpReturnOK = !IsErrorStatus(exec);
+                    if (interpReturnOK)
+                        CHECK_BRANCH();
+                    REGS.sp = args.spAfterCall();
+                    goto jit_return;
+                }
             }
         }
 
-        if (jit::IsBaselineEnabled(cx)) {
-            jit::MethodStatus status = jit::CanEnterBaselineMethod(cx, state.ref());
-            if (status == jit::Method_Error)
-                goto error;
-            if (status == jit::Method_Compiled) {
-                jit::JitExecStatus exec = jit::EnterBaselineMethod(cx, state.ref());
-                interpReturnOK = !IsErrorStatus(exec);
-                if (interpReturnOK)
-                    CHECK_BRANCH();
-                REGS.sp = args.spAfterCall();
-                goto jit_return;
-            }
-        }
-
-        state.reset();
         funScript = fun->nonLazyScript();
 
         if (!activation.pushInlineFrame(args, funScript, construct))
             goto error;
 
         if (createSingleton)
             REGS.fp()->setCreateSingleton();
     }