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

Unified Diff: runtime/vm/object_graph.cc

Issue 1179973005: Make ObjectGraph wait for concurrent sweeper before using mark bits (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | runtime/vm/object_graph_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_graph.cc
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index f50046896face8357917abecee537691a61c7f61..b07fe0a90637f15965a6e46660fa3154451c1a8e 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -147,11 +147,6 @@ class Unmarker : public ObjectVisitor {
}
static void UnmarkAll(Isolate* isolate) {
- PageSpace* old_space = isolate->heap()->old_space();
- MonitorLocker ml(old_space->tasks_lock());
- while (old_space->tasks() > 0) {
- ml.Wait();
- }
Unmarker unmarker(isolate);
isolate->heap()->VisitObjects(&unmarker);
}
@@ -177,6 +172,11 @@ ObjectGraph::~ObjectGraph() {
void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) {
NoSafepointScope no_safepoint_scope_;
+ PageSpace* old_space = isolate()->heap()->old_space();
+ MonitorLocker ml(old_space->tasks_lock());
+ while (old_space->tasks() > 0) {
+ ml.Wait();
+ }
Stack stack(isolate());
isolate()->VisitObjectPointers(&stack, false, false);
stack.TraverseGraph(visitor);
@@ -187,6 +187,11 @@ void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) {
void ObjectGraph::IterateObjectsFrom(const Object& root,
ObjectGraph::Visitor* visitor) {
NoSafepointScope no_safepoint_scope_;
+ PageSpace* old_space = isolate()->heap()->old_space();
+ MonitorLocker ml(old_space->tasks_lock());
+ while (old_space->tasks() > 0) {
+ ml.Wait();
+ }
Stack stack(isolate());
RawObject* root_raw = root.raw();
stack.VisitPointer(&root_raw);
« no previous file with comments | « no previous file | runtime/vm/object_graph_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698