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 1012593004: Repeatedly overapproximate the weak closure as long as we make progress (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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 | « src/heap/incremental-marking.h ('k') | 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 bd0c0928cdc19f86feeaae5bc10dd8b69869c2fd..64145abb8bff1b18205aec2b300ec6f7b3d7f945 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -30,6 +30,7 @@ IncrementalMarking::IncrementalMarking(Heap* heap)
unscanned_bytes_of_large_object_(0),
was_activated_(false),
weak_closure_was_overapproximated_(false),
+ weak_closure_approximation_rounds_(0),
request_type_(COMPLETE_MARKING) {}
@@ -549,8 +550,8 @@ void IncrementalMarking::MarkObjectGroups() {
DCHECK(FLAG_overapproximate_weak_closure);
DCHECK(!weak_closure_was_overapproximated_);
- GCTracer::Scope gc_scope(heap_->tracer(),
- GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
+ int old_marking_deque_top =
+ heap_->mark_compact_collector()->marking_deque()->top();
heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkObject);
@@ -558,10 +559,19 @@ void IncrementalMarking::MarkObjectGroups() {
heap_->isolate()->global_handles()->IterateObjectGroups(
&visitor, &MarkCompactCollector::IsUnmarkedHeapObjectWithHeap);
+ int marking_progress =
+ abs(old_marking_deque_top -
+ heap_->mark_compact_collector()->marking_deque()->top());
+
+ ++weak_closure_approximation_rounds_;
+ if ((weak_closure_approximation_rounds_ >=
+ FLAG_max_object_groups_marking_rounds) ||
+ (marking_progress < FLAG_min_progress_during_object_groups_marking)) {
+ weak_closure_was_overapproximated_ = true;
+ }
+
heap_->isolate()->global_handles()->RemoveImplicitRefGroups();
heap_->isolate()->global_handles()->RemoveObjectGroups();
-
- weak_closure_was_overapproximated_ = true;
}
@@ -819,6 +829,7 @@ void IncrementalMarking::MarkingComplete(CompletionAction action) {
void IncrementalMarking::Epilogue() {
was_activated_ = false;
weak_closure_was_overapproximated_ = false;
+ weak_closure_approximation_rounds_ = 0;
}
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698