Bug 839982 part 6 - Create |this| before creating the resume point when inlining NEW. r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 12 Feb 2013 13:11:28 +0100
changeset 131501 7b06c456f336839de9dcb6368aabe5e1d04847f3
parent 131500 16ddbb6852ecca9e7b167604105d875d03ec6368
child 131502 f67abd9e378aed3b4c9dd0783e66f85ea2cf2f70
child 138228 b5dfabd937f11973c844e312137ff9035c990dc4
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdjvj
bugs839982
milestone21.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 839982 part 6 - Create |this| before creating the resume point when inlining NEW. r=djvj
js/src/ion/IonBuilder.cpp
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -2862,16 +2862,24 @@ IonBuilder::inlineScriptedCall(HandleFun
 
     // Make sure there is enough place in the slots
     uint32_t depth = current->stackDepth() + callInfo.argc() + 2;
     if (depth > current->nslots()) {
         if (!current->increaseSlots(depth - current->nslots()))
             return false;
     }
 
+    // Create new |this| on the caller-side for inlined constructors.
+    if (callInfo.constructing()) {
+        MDefinition *thisDefn = createThis(target, callInfo.fun());
+        if (!thisDefn)
+            return false;
+        callInfo.setThis(thisDefn);
+    }
+
     // Push formals to capture in the resumepoint
     callInfo.pushFormals(current);
 
     MResumePoint *resumePoint =
         MResumePoint::New(current, pc, callerResumePoint_, MResumePoint::Outer);
     if (!resumePoint)
         return false;
 
@@ -2893,24 +2901,16 @@ IonBuilder::inlineScriptedCall(HandleFun
 
     TypeInferenceOracle oracle;
     if (!oracle.init(cx, calleeScript))
         return false;
 
     IonBuilder inlineBuilder(cx, &temp(), &graph(), &oracle,
                              info, inliningDepth + 1, loopDepth_);
 
-    // Create new |this| on the caller-side for inlined constructors.
-    if (callInfo.constructing()) {
-        MDefinition *thisDefn = createThis(target, callInfo.fun());
-        if (!thisDefn)
-            return false;
-        callInfo.setThis(thisDefn);
-    }
-
     // Build the graph.
     if (!inlineBuilder.buildInline(this, resumePoint, callInfo)) {
         JS_ASSERT(calleeScript->hasAnalysis());
 
         // Inlining the callee failed. Disable inlining the function
         if (inlineBuilder.abortReason_ == AbortReason_Disable)
             calleeScript->analysis()->setIonUninlineable();