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

Unified Diff: src/heap/heap.cc

Issue 767233003: Perform smaller marking steps incrementally in idle notification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 8986087486995ac660de31f0d164b0a03ebc37f4..fa327641250cd51d24d01f822ff04e641a758ab4 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4489,12 +4489,18 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
if (incremental_marking()->IsStopped()) {
incremental_marking()->Start();
}
- incremental_marking()->Step(action.parameter,
- IncrementalMarking::NO_GC_VIA_STACK_GUARD,
- IncrementalMarking::FORCE_MARKING,
- IncrementalMarking::DO_NOT_FORCE_COMPLETION);
- double remaining_idle_time_in_ms =
- deadline_in_ms - MonotonicallyIncreasingTimeInMs();
+ double remaining_idle_time_in_ms = 0.0;
+ do {
+ incremental_marking()->Step(
+ action.parameter, IncrementalMarking::NO_GC_VIA_STACK_GUARD,
+ IncrementalMarking::FORCE_MARKING,
+ IncrementalMarking::DO_NOT_FORCE_COMPLETION);
+ remaining_idle_time_in_ms =
+ deadline_in_ms - MonotonicallyIncreasingTimeInMs();
+ } while (remaining_idle_time_in_ms >=
+ 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs &&
+ !incremental_marking()->IsComplete() &&
+ !mark_compact_collector_.marking_deque()->IsEmpty());
if (remaining_idle_time_in_ms > 0.0) {
TryFinalizeIdleIncrementalMarking(
remaining_idle_time_in_ms, heap_state.size_of_objects,
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698