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

Unified Diff: src/heap/incremental-marking.cc

Issue 1853463004: [heap] Abort AdvanceIncrementalMarking when we do not make marking progress. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index e49b1f1ec304640041e5a4dfa74042f9c59087f2..5194e8b24ec154f58394f164566e978a3e5df52a 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -1030,12 +1030,15 @@ double IncrementalMarking::AdvanceIncrementalMarking(
}
double remaining_time_in_ms = 0.0;
+ intptr_t bytes_processed = 0;
do {
- Step(step_size_in_bytes, step_actions.completion_action,
- step_actions.force_marking, step_actions.force_completion);
+ bytes_processed =
+ Step(step_size_in_bytes, step_actions.completion_action,
+ step_actions.force_marking, step_actions.force_completion);
remaining_time_in_ms =
deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs();
- } while (remaining_time_in_ms >=
+ } while (bytes_processed > 0 &&
+ remaining_time_in_ms >=
2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs &&
!IsComplete() &&
!heap()->mark_compact_collector()->marking_deque()->IsEmpty());
@@ -1183,7 +1186,8 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
bytes_scanned_ = 0;
StartMarking();
}
- } else if (state_ == MARKING) {
Hannes Payer (out of office) 2016/04/01 12:48:24 This is a slight policy change. However, I don't t
+ }
+ if (state_ == MARKING) {
bytes_processed = ProcessMarkingDeque(bytes_to_process);
if (heap_->mark_compact_collector()->marking_deque()->IsEmpty()) {
if (completion == FORCE_COMPLETION ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698