Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 344441dfdb4bd3cc7287bc0ba5f384af7833cff1..34e2b3c63c95f65165d23a504f88d62c5b1a0d72 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -5297,12 +5297,16 @@ void Heap::DampenOldGenerationAllocationLimit(size_t old_gen_size, |
// major GC. It happens when the old generation allocation limit is reached and |
// - either we need to optimize for memory usage, |
// - or the incremental marking is not in progress and we cannot start it. |
-bool Heap::ShouldExpandOldGenerationOnAllocationFailure() { |
+bool Heap::ShouldExpandOldGenerationOnSlowAllocation() { |
if (always_allocate() || OldGenerationSpaceAvailable() > 0) return true; |
// We reached the old generation allocation limit. |
if (ShouldOptimizeForMemoryUsage()) return false; |
+ if (incremental_marking()->NeedsFinalization()) { |
+ return false; |
+ } |
+ |
if (incremental_marking()->IsStopped() && |
IncrementalMarkingLimitReached() == IncrementalMarkingLimit::kNoLimit) { |
// We cannot start incremental marking. |