Properly report OOM when deoptimizer allocation fails

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1052823003

Cr-Commit-Position: refs/heads/master@{#27900}
This commit is contained in:
erikcorry 2015-04-16 11:05:32 -07:00 committed by Commit bot
parent 6b59e1f155
commit db04a5ad6f

View File

@ -2803,7 +2803,10 @@ void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate,
MemoryChunk* chunk = data->deopt_entry_code_[type];
CHECK(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >=
desc.instr_size);
chunk->CommitArea(desc.instr_size);
if (!chunk->CommitArea(desc.instr_size)) {
V8::FatalProcessOutOfMemory(
"Deoptimizer::EnsureCodeForDeoptimizationEntry");
}
CopyBytes(chunk->area_start(), desc.buffer,
static_cast<size_t>(desc.instr_size));
CpuFeatures::FlushICache(chunk->area_start(), desc.instr_size);