Bug 1264948 - Disable infallible allocator assertion for iregexp. r=bhackett
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Mon, 20 Jun 2016 13:54:08 +0000
changeset 302087 02d9acf640f594ae1d474747c2d7a6cb399e4258
parent 302086 4b5c2c00f20a333eb8b0fe633d3326bf0236fdff
child 302088 42b04c4bae8f414001d848aa17cc0290938c3413
push id78584
push usernpierron@mozilla.com
push dateMon, 20 Jun 2016 13:54:38 +0000
treeherdermozilla-inbound@ab5f00905c50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1264948
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 1264948 - Disable infallible allocator assertion for iregexp. r=bhackett
js/src/irregexp/RegExpEngine.cpp
--- a/js/src/irregexp/RegExpEngine.cpp
+++ b/js/src/irregexp/RegExpEngine.cpp
@@ -1715,16 +1715,22 @@ RegExpCode
 RegExpCompiler::Assemble(JSContext* cx,
                          RegExpMacroAssembler* assembler,
                          RegExpNode* start,
                          int capture_count)
 {
     macro_assembler_ = assembler;
     macro_assembler_->set_slow_safe(false);
 
+    // The LifoAlloc used by the regexp compiler is infallible and is currently
+    // expected to crash on OOM. Thus we have to disable the assertions made to
+    // prevent us from allocating any new chunk in the LifoAlloc. This is needed
+    // because the jit::MacroAssembler turns these assertions on by default.
+    LifoAlloc::AutoFallibleScope fallibleAllocator(alloc());
+
     jit::Label fail;
     macro_assembler_->PushBacktrack(&fail);
     Trace new_trace;
     start->Emit(this, &new_trace);
     macro_assembler_->BindBacktrack(&fail);
     macro_assembler_->Fail();
 
     while (!work_list_.empty())