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

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

Issue 1865333002: [heap] Make sure that we transition to MARKING when we are finalize SWEEPING. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/incremental-marking.h ('k') | src/heap/incremental-marking-job.cc » ('j') | 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 87d082c19003d4e9d256f464c3861ed78f77eaf3..cdc245cd2233aacfe2d413e6a96b3d4d5dc0845e 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -1107,6 +1107,18 @@ void IncrementalMarking::SpeedUp() {
}
}
+void IncrementalMarking::FinalizeSweeping() {
+ DCHECK(state_ == SWEEPING);
+ if (heap_->mark_compact_collector()->sweeping_in_progress() &&
+ (heap_->mark_compact_collector()->IsSweepingCompleted() ||
+ !FLAG_concurrent_sweeping)) {
+ heap_->mark_compact_collector()->EnsureSweepingCompleted();
+ }
+ if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
+ bytes_scanned_ = 0;
+ StartMarking();
+ }
+}
intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
CompletionAction action,
@@ -1156,17 +1168,11 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
bytes_scanned_ += bytes_to_process;
+ // TODO(hpayer): Do not account for sweeping finalization while marking.
if (state_ == SWEEPING) {
- if (heap_->mark_compact_collector()->sweeping_in_progress() &&
- (heap_->mark_compact_collector()->IsSweepingCompleted() ||
- !FLAG_concurrent_sweeping)) {
- heap_->mark_compact_collector()->EnsureSweepingCompleted();
- }
- if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
- bytes_scanned_ = 0;
- StartMarking();
- }
+ FinalizeSweeping();
}
+
if (state_ == MARKING) {
bytes_processed = ProcessMarkingDeque(bytes_to_process);
if (heap_->mark_compact_collector()->marking_deque()->IsEmpty()) {
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/incremental-marking-job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698