Bug 1289025 - Ensure enough ballast space in MakeMRegExpHoistable. r=arai
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Tue, 26 Jul 2016 13:00:16 +0000
changeset 348820 39784b9cd9262a7ed15d31dc1f5b8f2cbf8ab412
parent 348819 37e371c92c11c20fa0a8dd32f4f6ecee7aea7b49
child 348821 d504768f3183ab17001e1167bbee36822c159f2e
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1289025
milestone50.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 1289025 - Ensure enough ballast space in MakeMRegExpHoistable. r=arai
js/src/jit/IonAnalysis.cpp
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -2134,16 +2134,18 @@ jit::MakeMRegExpHoistable(MIRGraph& grap
             regexp->setMovable();
             regexp->setDoNotClone();
 
             // That would be incorrect for global/sticky, because lastIndex
             // could be wrong.  Therefore setting the lastIndex to 0. That is
             // faster than a not movable regexp.
             RegExpObject* source = regexp->source();
             if (source->sticky() || source->global()) {
+                if (!graph.alloc().ensureBallast())
+                    return false;
                 MConstant* zero = MConstant::New(graph.alloc(), Int32Value(0));
                 regexp->block()->insertAfter(regexp, zero);
 
                 MStoreFixedSlot* lastIndex =
                     MStoreFixedSlot::New(graph.alloc(), regexp, RegExpObject::lastIndexSlot(), zero);
                 regexp->block()->insertAfter(zero, lastIndex);
             }
         }