Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 071816f35f5ef197fa6c0f96805072d38ffbe391..525e78461edf19e05f16d50e2b8ff6f25879df4d 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -2889,19 +2889,7 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { |
} |
} |
- // Free list allocation failed and there is no next page. Fail if we have |
- // hit the old generation size limit that should cause a garbage |
- // collection. |
- if (!heap()->always_allocate() && |
- heap()->OldGenerationAllocationLimitReached()) { |
- // If sweeper threads are active, wait for them at that point and steal |
- // elements form their free-lists. |
- HeapObject* object = SweepAndRetryAllocation(size_in_bytes); |
- return object; |
- } |
- |
- // Try to expand the space and allocate in the new next page. |
- if (Expand()) { |
+ if (heap()->ShouldExpandOldGenerationOnAllocationFailure() && Expand()) { |
DCHECK((CountTotalPages() > 1) || |
(size_in_bytes <= free_list_.Available())); |
return free_list_.Allocate(size_in_bytes); |