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

Unified Diff: runtime/vm/gc_sweeper.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 11 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
Index: runtime/vm/gc_sweeper.cc
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index a192138b4c6f5a72ddf92f2360cb4ea8c7ded1e4..25c00a098aa2b9fe214fd719016aedc1aa49833c 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -9,8 +9,8 @@
#include "vm/heap.h"
#include "vm/lockers.h"
#include "vm/pages.h"
+#include "vm/safepoint.h"
#include "vm/thread_pool.h"
-#include "vm/thread_registry.h"
namespace dart {
@@ -116,13 +116,13 @@ class SweeperTask : public ThreadPool::Task {
virtual void Run() {
bool result = Thread::EnterIsolateAsHelper(task_isolate_);
ASSERT(result);
+ Thread* thread = Thread::Current();
GCSweeper sweeper;
HeapPage* page = first_;
HeapPage* prev_page = NULL;
while (page != NULL) {
- task_isolate_->thread_registry()->CheckSafepoint();
HeapPage* next_page = page->next();
ASSERT(page->type() == HeapPage::kData);
bool page_in_use = sweeper.SweepPage(page, freelist_, false);
@@ -134,6 +134,7 @@ class SweeperTask : public ThreadPool::Task {
{
// Notify the mutator thread that we have added elements to the free
// list or that more capacity is available.
+ TransitionVMToBlocked transition(thread);
zra 2016/01/08 23:32:07 I think I'm a little confused by the meaning of th
siva 2016/01/12 21:26:22 True this was a hack I did initially to get things
MonitorLocker ml(old_space_->tasks_lock());
ml.Notify();
}

Powered by Google App Engine
This is Rietveld 408576698