OLD | NEW |
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" |
11 #include "vm/pages.h" | 11 #include "vm/pages.h" |
12 #include "vm/safepoint.h" | 12 #include "vm/safepoint.h" |
13 #include "vm/thread_pool.h" | 13 #include "vm/thread_pool.h" |
14 #include "vm/timeline.h" | 14 #include "vm/timeline.h" |
15 | 15 |
16 namespace dart { | 16 namespace dart { |
17 | 17 |
18 bool GCSweeper::SweepPage(HeapPage* page, FreeList* freelist, bool locked) { | 18 bool GCSweeper::SweepPage(HeapPage* page, FreeList* freelist, bool locked) { |
19 if (page->embedder_allocated()) { | 19 if (page->is_image_page()) { |
20 // Don't clear mark bits. | 20 // Don't clear mark bits. |
21 return true; | 21 return true; |
22 } | 22 } |
23 | 23 |
24 // Keep track whether this page is still in use. | 24 // Keep track whether this page is still in use. |
25 bool in_use = false; | 25 bool in_use = false; |
26 | 26 |
27 bool is_executable = (page->type() == HeapPage::kExecutable); | 27 bool is_executable = (page->type() == HeapPage::kExecutable); |
28 uword start = page->object_start(); | 28 uword start = page->object_start(); |
29 uword end = page->object_end(); | 29 uword end = page->object_end(); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 HeapPage* first, | 173 HeapPage* first, |
174 HeapPage* last, | 174 HeapPage* last, |
175 FreeList* freelist) { | 175 FreeList* freelist) { |
176 SweeperTask* task = new SweeperTask(isolate, isolate->heap()->old_space(), | 176 SweeperTask* task = new SweeperTask(isolate, isolate->heap()->old_space(), |
177 first, last, freelist); | 177 first, last, freelist); |
178 ThreadPool* pool = Dart::thread_pool(); | 178 ThreadPool* pool = Dart::thread_pool(); |
179 pool->Run(task); | 179 pool->Run(task); |
180 } | 180 } |
181 | 181 |
182 } // namespace dart | 182 } // namespace dart |
OLD | NEW |