Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: src/heap/gc-idle-time-handler.cc

Issue 1071503002: Version 4.3.61.2 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/heap/gc-idle-time-handler.h ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698