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

Unified Diff: src/heap/mark-compact.cc

Issue 989173004: Before overapproximating the weak closure, make sure the marking deque is empty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « 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/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 44262e42b162b58974cf7b2092ea141047856d2a..aacae732e06d0ce127dc9d77539aa13e9ce032ad 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2211,11 +2211,18 @@ void MarkCompactCollector::OverApproximateWeakClosure() {
GCTracer::Scope gc_scope(heap()->tracer(),
GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
+ // Make sure that the marking deque is empty, even if it has overflown.
+ // Otherwise, we might miss some objects in an object group that would
+ // otherwise made the entire group alive.
+ ProcessMarkingDeque();
+
RootMarkingVisitor root_visitor(heap());
isolate()->global_handles()->IterateObjectGroups(
&root_visitor, &IsUnmarkedHeapObjectWithHeap);
MarkImplicitRefGroups();
+ DCHECK(marking_deque_.overflowed());
Hannes Payer (out of office) 2015/03/10 13:09:28 Why do we check here for overflowed?
+
// Remove object groups after marking phase.
heap()->isolate()->global_handles()->RemoveObjectGroups();
heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
« 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