Bug 1245152 - Ensure enough ballast space before RangeAnalysis::tryHoistBoundsCheck. r=h4writer
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 17 Feb 2016 18:12:14 +0000
changeset 331628 93e0395f69fbe1242899b5e54610f4ad2d80ad27
parent 331627 c5d6c3e00c91dd0595a12b145c66cf4f2a890591
child 331629 4ec66e6db2d2df54f1fa61b093c11e385f5c2860
push id11020
push userjolesen@mozilla.com
push dateWed, 17 Feb 2016 18:16:38 +0000
reviewersh4writer
bugs1245152
milestone47.0a1
Bug 1245152 - Ensure enough ballast space before RangeAnalysis::tryHoistBoundsCheck. r=h4writer
js/src/jit/RangeAnalysis.cpp
--- a/js/src/jit/RangeAnalysis.cpp
+++ b/js/src/jit/RangeAnalysis.cpp
@@ -1907,16 +1907,18 @@ RangeAnalysis::analyzeLoop(MBasicBlock* 
         for (ReversePostorderIterator iter(graph_.rpoBegin(header)); iter != graph_.rpoEnd(); iter++) {
             MBasicBlock* block = *iter;
             if (!block->isMarked())
                 continue;
 
             for (MDefinitionIterator iter(block); iter; iter++) {
                 MDefinition* def = *iter;
                 if (def->isBoundsCheck() && def->isMovable()) {
+                    if (!alloc().ensureBallast())
+                        return false;
                     if (tryHoistBoundsCheck(header, def->toBoundsCheck())) {
                         if (!hoistedChecks.append(def->toBoundsCheck()))
                             return false;
                     }
                 }
             }
         }