Bug 1132888 part 2 - Prevent spewers from consuming almost all the ballast space. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2016-11-08 14:06:38 +00:00
Родитель 8425620cf7
Коммит fea3a703a3
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -21,6 +21,7 @@
#include "jit/Ion.h"
#include "jit/MIR.h"
#include "jit/MIRGenerator.h"
#include "jit/MIRGraph.h"
#include "threading/LockGuard.h"
@ -302,6 +303,13 @@ GraphSpewer::spewPass(const char* pass)
jsonSpewer_.endPass();
ionspewer.spewPass(this);
// As this function is used for debugging, we ignore any of the previous
// failures and ensure there is enough ballast space, such that we do not
// exhaust the ballast space before running the next phase.
AutoEnterOOMUnsafeRegion oomUnsafe;
if (!graph_->alloc().ensureBallast())
oomUnsafe.crash("Could not ensure enough ballast space after spewing graph information.");
}
void