| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index e95dd2965ba708eabe6c6fbd18b0a13d6c0adce2..b1015c01e0a0f25c84ad12d4a1d3c066a29fbb08 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -5304,6 +5304,13 @@ void Heap::DampenOldGenerationAllocationLimit(size_t old_gen_size,
|
| }
|
| }
|
|
|
| +bool Heap::ShouldOptimizeForLoadTime() {
|
| + return isolate()->rail_mode() == PERFORMANCE_LOAD &&
|
| + PromotedTotalSize() < initial_old_generation_size_ &&
|
| + MonotonicallyIncreasingTimeInMs() <
|
| + isolate()->LoadStartTimeMs() + kMaxLoadTimeMs;
|
| +}
|
| +
|
| // This predicate is called when an old generation space cannot allocated from
|
| // the free list and is about to add a new page. Returning false will cause a
|
| // major GC. It happens when the old generation allocation limit is reached and
|
| @@ -5315,6 +5322,8 @@ bool Heap::ShouldExpandOldGenerationOnSlowAllocation() {
|
|
|
| if (ShouldOptimizeForMemoryUsage()) return false;
|
|
|
| + if (ShouldOptimizeForLoadTime()) return true;
|
| +
|
| if (incremental_marking()->NeedsFinalization()) {
|
| return !AllocationLimitOvershotByLargeMargin();
|
| }
|
|
|