Properly report OOM when deoptimizer allocation fails
authorerikcorry <erikcorry@chromium.org>
Thu, 16 Apr 2015 18:05:32 +0000 (11:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 16 Apr 2015 18:05:22 +0000 (18:05 +0000)
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27900}

src/deoptimizer.cc

index 227f238..eaedb2c 100644 (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);