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

Side by Side Diff: runtime/vm/gc_sweeper.cc

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 years 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/gc_sweeper.h" 5 #include "vm/gc_sweeper.h"
6 6
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ASSERT(first_ != NULL); 107 ASSERT(first_ != NULL);
108 ASSERT(old_space_ != NULL); 108 ASSERT(old_space_ != NULL);
109 ASSERT(last_ != NULL); 109 ASSERT(last_ != NULL);
110 ASSERT(freelist_ != NULL); 110 ASSERT(freelist_ != NULL);
111 MonitorLocker ml(old_space_->tasks_lock()); 111 MonitorLocker ml(old_space_->tasks_lock());
112 old_space_->set_tasks(old_space_->tasks() + 1); 112 old_space_->set_tasks(old_space_->tasks() + 1);
113 ml.Notify(); 113 ml.Notify();
114 } 114 }
115 115
116 virtual void Run() { 116 virtual void Run() {
117 Thread::EnterIsolateAsHelper(task_isolate_); 117 bool result = Thread::EnterIsolateAsHelper(task_isolate_);
118 ASSERT(result);
118 GCSweeper sweeper; 119 GCSweeper sweeper;
119 120
120 HeapPage* page = first_; 121 HeapPage* page = first_;
121 HeapPage* prev_page = NULL; 122 HeapPage* prev_page = NULL;
122 123
123 while (page != NULL) { 124 while (page != NULL) {
124 task_isolate_->thread_registry()->CheckSafepoint(); 125 task_isolate_->thread_registry()->CheckSafepoint();
125 HeapPage* next_page = page->next(); 126 HeapPage* next_page = page->next();
126 ASSERT(page->type() == HeapPage::kData); 127 ASSERT(page->type() == HeapPage::kData);
127 bool page_in_use = sweeper.SweepPage(page, freelist_, false); 128 bool page_in_use = sweeper.SweepPage(page, freelist_, false);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 SweeperTask* task = 166 SweeperTask* task =
166 new SweeperTask(isolate, 167 new SweeperTask(isolate,
167 isolate->heap()->old_space(), 168 isolate->heap()->old_space(),
168 first, last, 169 first, last,
169 freelist); 170 freelist);
170 ThreadPool* pool = Dart::thread_pool(); 171 ThreadPool* pool = Dart::thread_pool();
171 pool->Run(task); 172 pool->Run(task);
172 } 173 }
173 174
174 } // namespace dart 175 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698