Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index a274fddf45d5b8fd2d31578ccc07bb416752e9e2..dd52bcac5953413ce00932b70a1761e930ee892a 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); |