| Index: src/heap/gc-idle-time-handler.cc
|
| diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc
|
| index 80417a7f25dcf81c20ebf6b8916f3855a82f5278..250fb12ca0be2c08c97327aed949ef2512357dae 100644
|
| --- a/src/heap/gc-idle-time-handler.cc
|
| +++ b/src/heap/gc-idle-time-handler.cc
|
| @@ -184,11 +184,22 @@ bool GCIdleTimeHandler::ShouldDoOverApproximateWeakClosure(
|
| }
|
|
|
|
|
| +GCIdleTimeAction GCIdleTimeHandler::NothingOrDone() {
|
| + if (idle_times_which_made_no_progress_since_last_idle_round_ >=
|
| + kMaxNoProgressIdleTimesPerIdleRound) {
|
| + return GCIdleTimeAction::Done();
|
| + } else {
|
| + idle_times_which_made_no_progress_since_last_idle_round_++;
|
| + return GCIdleTimeAction::Nothing();
|
| + }
|
| +}
|
| +
|
| +
|
| // The following logic is implemented by the controller:
|
| // (1) If we don't have any idle time, do nothing, unless a context was
|
| // disposed, incremental marking is stopped, and the heap is small. Then do
|
| // a full GC.
|
| -// (2) If the new space is almost full and we can affort a Scavenge or if the
|
| +// (2) If the new space is almost full and we can afford a Scavenge or if the
|
| // next Scavenge will very likely take long, then a Scavenge is performed.
|
| // (3) If there is currently no MarkCompact idle round going on, we start a
|
| // new idle round if enough garbage was created. Otherwise we do not perform
|
| @@ -249,8 +260,9 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms,
|
|
|
| if (heap_state.incremental_marking_stopped &&
|
| !heap_state.can_start_incremental_marking) {
|
| - return GCIdleTimeAction::Nothing();
|
| + return NothingOrDone();
|
| }
|
| +
|
| size_t step_size = EstimateMarkingStepSize(
|
| static_cast<size_t>(kIncrementalMarkingStepTimeInMs),
|
| heap_state.incremental_marking_speed_in_bytes_per_ms);
|
|
|