[api] Avoid recursive GCs through reaching external allocation limit
authormlippautz <mlippautz@chromium.org>
Tue, 29 Sep 2015 19:17:23 +0000 (12:17 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 29 Sep 2015 19:17:34 +0000 (19:17 +0000)
See bug description.

BUG=chromium:536231
LOG=N

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

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

src/api.cc

index dbe7670..cfc170e 100644 (file)
@@ -6839,7 +6839,7 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
 
 void Isolate::ReportExternalAllocationLimitReached() {
   i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
-  DCHECK_EQ(heap->gc_state(), i::Heap::NOT_IN_GC);
+  if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
   heap->ReportExternalMemoryPressure(
       "external memory allocation limit reached.");
 }