From db04a5ad6f34da95ad54cda97ca70d6805cc5978 Mon Sep 17 00:00:00 2001 From: erikcorry Date: Thu, 16 Apr 2015 11:05:32 -0700 Subject: [PATCH] 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} --- src/deoptimizer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc index 227f23859f..eaedb2cd07 100644 --- a/src/deoptimizer.cc +++ b/src/deoptimizer.cc @@ -2803,7 +2803,10 @@ void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate, MemoryChunk* chunk = data->deopt_entry_code_[type]; CHECK(static_cast(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(desc.instr_size)); CpuFeatures::FlushICache(chunk->area_start(), desc.instr_size);