Bug 869529 - Fix LiveRangeAllocator loopWorkList handling. r=bhackett
authorKannan Vijayan <kvijayan@mozilla.com>
Tue, 07 May 2013 14:49:02 -0400
changeset 131161 0a50d67075be
parent 131160 7f1def8c39e8
child 131162 a2eebc32a77c
push id24649
push userryanvm@gmail.com
push date2013-05-08 02:10 +0000
treeherdermozilla-central@b980d32c366f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs869529
milestone23.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 869529 - Fix LiveRangeAllocator loopWorkList handling. r=bhackett
js/src/ion/LiveRangeAllocator.cpp
--- a/js/src/ion/LiveRangeAllocator.cpp
+++ b/js/src/ion/LiveRangeAllocator.cpp
@@ -786,19 +786,27 @@ LiveRangeAllocator<VREG>::buildLivenessI
                     }
                 }
 
                 // Terminate loop if out of work.
                 if (loopWorkList.empty())
                     break;
 
                 // Grab the next block off the work list, skipping any OSR block.
-                do {
+                while (!loopWorkList.empty()) {
                     loopBlock = loopWorkList.popCopy();
-                } while (loopBlock->lir() == graph.osrBlock());
+                    if (loopBlock->lir() != graph.osrBlock())
+                        break;
+                }
+
+                // If end is reached without finding a non-OSR block, then no more work items were found.
+                if (loopBlock->lir() == graph.osrBlock()) {
+                    JS_ASSERT(loopWorkList.empty());
+                    break;
+                }
             }
 
             // Clear the done set for other loops
             loopDone->clear();
         }
 
         JS_ASSERT_IF(!mblock->numPredecessors(), live->empty());
     }