Bug 984830 - IonMonkey: Ignore unkown types when improving type information at branches. r=jandem, a=lsblakk
authorHannes Verschore <hv1989@gmail.com>
Thu, 03 Apr 2014 09:30:53 +0200
changeset 191583 eb5fc4360489283785c41d22ef8c7f4f23e1588c
parent 191582 ccb24c1157248f3d1b9339cb9293198dcbc89de6
child 191584 5563ddcf6e667116638f7ecb9bbd2c489e1f9f8e
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, lsblakk
bugs984830
milestone30.0a2
Bug 984830 - IonMonkey: Ignore unkown types when improving type information at branches. r=jandem, a=lsblakk
js/src/jit-test/tests/ion/bug984830.js
js/src/jit/IonBuilder.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug984830.js
@@ -0,0 +1,15 @@
+function getTestCaseResult(expected, actual) {
+      if (actual != expected)
+              return Math.abs(actual - expected) <= 1E-10;
+}
+function InstanceOf(object, constructor) {
+      while ( object != null )
+              object = object.__proto__;
+}
+function WorkerBee () {}
+function Engineer () {}
+Engineer.prototype = new WorkerBee();
+var pat = new Engineer();
+getTestCaseResult(pat.__proto__.__proto__.__proto__.__proto__ == Object.prototype);
+getTestCaseResult(InstanceOf(pat, Engineer));
+evaluate("getTestCaseResult( Object.prototype.__proto__ );", { compileAndGo: true });
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -3030,17 +3030,17 @@ IonBuilder::filterTypesAtTest(MTest *tes
 
     test->filtersUndefinedOrNull(trueBranch, &subject, &removeUndefined, &removeNull);
 
     // The test filters no undefined or null.
     if (!subject)
         return true;
 
     // There is no TypeSet that can get filtered.
-    if (!subject->resultTypeSet())
+    if (!subject->resultTypeSet() || subject->resultTypeSet()->unknown())
         return true;
 
     // Only do this optimization if the typeset does contains null or undefined.
     if ((!(removeUndefined && subject->resultTypeSet()->hasType(types::Type::UndefinedType())) &&
          !(removeNull && subject->resultTypeSet()->hasType(types::Type::NullType()))))
     {
         return true;
     }