Chromium Code Reviews| Index: src/heap/heap-inl.h |
| diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h |
| index 426e4326331cd84ced6fd02fc02deb00f3f1a912..d07025d432b6737a29d1f6b841b87d175f7f2b7c 100644 |
| --- a/src/heap/heap-inl.h |
| +++ b/src/heap/heap-inl.h |
| @@ -538,10 +538,18 @@ Isolate* Heap::isolate() { |
| AllocationResult __allocation__ = FUNCTION_CALL; \ |
| Object* __object__ = NULL; \ |
| RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \ |
| + bool __scavenge__ = (__allocation__.RetrySpace() == NEW_SPACE); \ |
| (ISOLATE)->heap()->CollectGarbage(__allocation__.RetrySpace(), \ |
| "allocation failure"); \ |
| __allocation__ = FUNCTION_CALL; \ |
| RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \ |
| + if (__scavenge__) { /* Second scavenge in a row will empty newspace */ \ |
| + (ISOLATE)->heap()->CollectGarbage(__allocation__.RetrySpace(), \ |
| + "insufficient newspace freed"); \ |
|
Hannes Payer (out of office)
2015/04/27 12:33:22
Let's do unconditionally a retry with the same spa
|
| + __allocation__ = FUNCTION_CALL; \ |
| + RETURN_OBJECT_UNLESS_RETRY(ISOLATE, RETURN_VALUE) \ |
| + \ |
| + } \ |
| (ISOLATE)->counters()->gc_last_resort_from_handles()->Increment(); \ |
| (ISOLATE)->heap()->CollectAllAvailableGarbage("last resort gc"); \ |
| { \ |