Bug 1247889 - Ensure enough ballast space in CodeGenerator::generateBody. r=h4writer
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Wed, 17 Feb 2016 18:12:14 +0000
changeset 331630 cfa9883c56b6e8654afd47d5f6f158bda7cbb096
parent 331629 4ec66e6db2d2df54f1fa61b093c11e385f5c2860
child 331631 c9431b91f57091c24cbcef01eed66d5fbc76f1ec
push id11020
push userjolesen@mozilla.com
push dateWed, 17 Feb 2016 18:16:38 +0000
reviewersh4writer
bugs1247889
milestone47.0a1
Bug 1247889 - Ensure enough ballast space in CodeGenerator::generateBody. r=h4writer
js/src/jit/CodeGenerator.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -4645,16 +4645,19 @@ CodeGenerator::generateBody()
                 return false;
         }
 
 #if defined(JS_ION_PERF)
         perfSpewer->startBasicBlock(current->mir(), masm);
 #endif
 
         for (LInstructionIterator iter = current->begin(); iter != current->end(); iter++) {
+            if (!alloc().ensureBallast())
+                return false;
+
 #ifdef JS_JITSPEW
             JitSpewStart(JitSpew_Codegen, "instruction %s", iter->opName());
             if (const char* extra = iter->extraName())
                 JitSpewCont(JitSpew_Codegen, ":%s", extra);
             JitSpewFin(JitSpew_Codegen);
 #endif
 
             if (counts)