Bug 901086 - Fix CodePosition comparison in LSRA findBestBlockedRegister. r=sunfish
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 26 Feb 2014 11:12:39 +0100
changeset 170985 2c92141f39bf398e336269e769ec5dd491a7de6d
parent 170984 802aa43ae8cc5948062a132efd3f9e798b949376
child 170986 af02f3883d7525cf68c8b9c6f9205dd536915dec
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssunfish
bugs901086
milestone30.0a1
Bug 901086 - Fix CodePosition comparison in LSRA findBestBlockedRegister. r=sunfish
js/src/jit-test/tests/ion/bug901086.js
js/src/jit/LinearScan.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug901086.js
@@ -0,0 +1,15 @@
+enableSPSProfilingAssertions(false);
+function foo(obj,x,y,z) {
+    if (!y)
+	assertEq(0, 1);
+    obj.x = x;
+    return y + z;
+}
+function bar() {
+    var objz = {x:2}
+    for(var i = 0; i < 1100; i++) {
+	foo(objz,1,2,3);
+	foo(objz, false, "bar", "foo");
+    }
+}
+bar();
--- a/js/src/jit/LinearScan.cpp
+++ b/js/src/jit/LinearScan.cpp
@@ -1074,17 +1074,17 @@ LinearScanAllocator::findBestBlockedRegi
     for (RegisterSet regs(allRegisters_); !regs.empty(needFloat); ) {
         AnyRegister reg = regs.takeAny(needFloat);
         nextUsePos[reg.code()] = CodePosition::MAX;
     }
     for (IntervalIterator i(active.begin()); i != active.end(); i++) {
         LAllocation *alloc = i->getAllocation();
         if (alloc->isRegister(needFloat)) {
             AnyRegister reg = alloc->toRegister();
-            if (i->start().ins() == current->start().ins()) {
+            if (i->start() == current->start()) {
                 nextUsePos[reg.code()] = CodePosition::MIN;
                 IonSpew(IonSpew_RegAlloc, "   Disqualifying %s due to recency", reg.name());
             } else if (nextUsePos[reg.code()] != CodePosition::MIN) {
                 nextUsePos[reg.code()] = i->nextUsePosAfter(current->start());
                 IonSpew(IonSpew_RegAlloc, "   Register %s next used %u", reg.name(),
                         nextUsePos[reg.code()].pos());
             }
         }