Rather than just infinite looping, or abort compilation on would-be iloops (bug 803470, r=dvander)
authorMarty Rosenberg <mrosenberg@mozilla.com>
Fri, 16 Nov 2012 09:12:49 -0500
changeset 113494 4f37c3ad5cda18e5df5d79332c5498975b2c96ad
parent 113493 326ed6f1dc9e0495809b1007b2d8cad6dbc8df40
child 113495 6f467d800beed0e378f7c6f5ddadcc7b789f8789
push id23872
push useremorley@mozilla.com
push dateFri, 16 Nov 2012 17:06:27 +0000
treeherdermozilla-central@a7ed19f7d21a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs803470
milestone19.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
Rather than just infinite looping, or abort compilation on would-be iloops (bug 803470, r=dvander)
js/src/ion/RangeAnalysis.cpp
--- a/js/src/ion/RangeAnalysis.cpp
+++ b/js/src/ion/RangeAnalysis.cpp
@@ -490,17 +490,19 @@ PopFromWorklist(MDefinitionVector &workl
     def->setNotInWorklist();
     return def;
 }
 
 
 bool
 RangeAnalysis::analyze()
 {
+    int numBlocks = 0;
     for (PostorderIterator i(graph_.poBegin()); i != graph_.poEnd(); i++) {
+        numBlocks++;
         MBasicBlock *curBlock = *i;
         if (!curBlock->isLoopHeader())
             continue;
         for (MPhiIterator pi(curBlock->phisBegin()); pi != curBlock->phisEnd(); pi++)
             if (!pi->initCounts())
                 return false;
     }
 
@@ -526,16 +528,18 @@ RangeAnalysis::analyze()
             IonSpew(IonSpew_Range, "Range changed; adding consumers");
             IonSpew(IonSpew_Range, "New range for %d is: (%d, %d)", def->id(), def->range()->lower(), def->range()->upper());
             for (MUseDefIterator use(def); use; use++) {
                 if(!AddToWorklist(worklist, use.def()))
                     return false;
             }
         }
         iters++;
+        if (iters >= numBlocks * 100)
+            return false;
     }
     // Cleanup (in case we stopped due to MAX_ITERS)
     for(size_t i = 0; i < worklist.length(); i++)
         worklist[i]->setNotInWorklist();
 
 
 #ifdef DEBUG
     for (ReversePostorderIterator block(graph_.rpoBegin()); block != graph_.rpoEnd(); block++) {