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

Unified Diff: runtime/vm/heap.cc

Issue 1282423003: Enable iterating over roots from helper threads by moving stack walking. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index eb3f79633d2e228c13e2515e171472a351c11996..4ac395c9c66eb49ab125b9266aaa590353e9529f 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -231,12 +231,15 @@ HeapIterationScope::HeapIterationScope()
MonitorLocker ml(old_space_->tasks_lock());
#if defined(DEBUG)
// We currently don't support nesting of HeapIterationScopes.
- ASSERT(!old_space_->is_iterating_);
- old_space_->is_iterating_ = true;
+ ASSERT(old_space_->iterating_thread_ != thread());
#endif
while (old_space_->tasks() > 0) {
ml.Wait();
}
+#if defined(DEBUG)
+ ASSERT(old_space_->iterating_thread_ == NULL);
+ old_space_->iterating_thread_ = thread();
+#endif
old_space_->set_tasks(1);
}
@@ -244,8 +247,8 @@ HeapIterationScope::HeapIterationScope()
HeapIterationScope::~HeapIterationScope() {
MonitorLocker ml(old_space_->tasks_lock());
#if defined(DEBUG)
- ASSERT(old_space_->is_iterating_);
- old_space_->is_iterating_ = false;
+ ASSERT(old_space_->iterating_thread_ == thread());
+ old_space_->iterating_thread_ = NULL;
#endif
ASSERT(old_space_->tasks() == 1);
old_space_->set_tasks(0);
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698