Bug 1204675: IonMonkey - Don't specialize using baseline stubs for strict equality, r=jandem
authorHannes Verschore <hv1989@gmail.com>
Fri, 18 Sep 2015 17:27:07 +0200
changeset 297587 ff69597b1ee495f1290a9a338679d8b5edf0873b
parent 297586 ef74a17b0963c6d1fc21e888b68bc67d9196ef7a
child 297588 6f1eb6ef900aa05534b9b78196a884d7f8bd40de
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1204675
milestone43.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 1204675: IonMonkey - Don't specialize using baseline stubs for strict equality, r=jandem
js/src/jit-test/tests/ion/bug1204675.js
js/src/jit/IonBuilder.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1204675.js
@@ -0,0 +1,13 @@
+function f(m, x) {
+        for (var i = 0; i < 2; ++i) {
+                    print(m(x[0]));
+                        }
+}
+function g() {
+        return false;
+}
+function h(y) {
+        return (y === 0);
+}
+f(g, [objectEmulatingUndefined()]);
+f(h, [false]);
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -6869,16 +6869,20 @@ IonBuilder::compareTrySpecializedOnBasel
                                                      MDefinition* right)
 {
     MOZ_ASSERT(*emitted == false);
 
     // Try to specialize based on any baseline caches that have been generated
     // for the opcode. These will cause the instruction's type policy to insert
     // fallible unboxes to the appropriate input types.
 
+    // Strict equality isn't supported.
+    if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE)
+        return true;
+
     MCompare::CompareType type = inspector->expectedCompareType(pc);
     if (type == MCompare::Compare_Unknown)
         return true;
 
     MCompare* ins = MCompare::New(alloc(), left, right, op);
     ins->setCompareType(type);
     ins->cacheOperandMightEmulateUndefined(constraints());