Bug 893853 - IonMonkey: Don't set typeset of |this| when type is unknown, r=bhackett
authorHannes Verschore <hv1989@gmail.com>
Fri, 19 Jul 2013 09:46:23 -0700
changeset 139267 84e6087150456a086f1133db74f70cc341a07f9d
parent 139266 c30555419404d0aec3369cf416c877aef9eb81ad
child 139268 2f26d189329b4025eed54a23864ee07e4777215a
push id24983
push userryanvm@gmail.com
push dateSat, 20 Jul 2013 00:51:06 +0000
treeherdermozilla-central@6030c759a502 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs893853
milestone25.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 893853 - IonMonkey: Don't set typeset of |this| when type is unknown, r=bhackett
js/src/ion/IonBuilder.cpp
js/src/jit-test/tests/ion/bug893853.js
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -3464,21 +3464,23 @@ IonBuilder::inlineScriptedCall(CallInfo 
     current->push(callInfo.fun());
 
     RootedScript calleeScript(cx, target->nonLazyScript());
     BaselineInspector inspector(cx, target->nonLazyScript());
 
     // Improve type information of |this| when not set.
     if (callInfo.constructing() && !callInfo.thisArg()->resultTypeSet()) {
         types::StackTypeSet *types = types::TypeScript::ThisTypes(calleeScript);
-        MTypeBarrier *barrier = MTypeBarrier::New(callInfo.thisArg(), cloneTypeSet(types), Bailout_Normal);
-        current->add(barrier);
-        MUnbox *unbox = MUnbox::New(barrier, MIRType_Object, MUnbox::Infallible);
-        current->add(unbox);
-        callInfo.setThis(unbox);
+        if (!types->unknown()) {
+            MTypeBarrier *barrier = MTypeBarrier::New(callInfo.thisArg(), cloneTypeSet(types), Bailout_Normal);
+            current->add(barrier);
+            MUnbox *unbox = MUnbox::New(barrier, MIRType_Object, MUnbox::Infallible);
+            current->add(unbox);
+            callInfo.setThis(unbox);
+        }
     }
 
     // Start inlining.
     LifoAlloc *alloc = GetIonContext()->temp->lifoAlloc();
     CompileInfo *info = alloc->new_<CompileInfo>(calleeScript.get(), target,
                                                  (jsbytecode *)NULL, callInfo.constructing(),
                                                  this->info().executionMode());
     if (!info)
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug893853.js
@@ -0,0 +1,9 @@
+
+function f() {}
+new EvalTest();
+function EvalTest() {
+  with (this) {
+    f(EvalTest)
+  }
+}
+evaluate("var obj = new f(1, 'x');");