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()) { |
| 20 // Don't clear mark bits. |
| 21 return true; |
| 22 } |
| 23 |
19 // Keep track whether this page is still in use. | 24 // Keep track whether this page is still in use. |
20 bool in_use = false; | 25 bool in_use = false; |
21 | 26 |
22 bool is_executable = (page->type() == HeapPage::kExecutable); | 27 bool is_executable = (page->type() == HeapPage::kExecutable); |
23 uword start = page->object_start(); | 28 uword start = page->object_start(); |
24 uword end = page->object_end(); | 29 uword end = page->object_end(); |
25 uword current = start; | 30 uword current = start; |
26 | 31 |
27 while (current < end) { | 32 while (current < end) { |
28 intptr_t obj_size; | 33 intptr_t obj_size; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 HeapPage* first, | 173 HeapPage* first, |
169 HeapPage* last, | 174 HeapPage* last, |
170 FreeList* freelist) { | 175 FreeList* freelist) { |
171 SweeperTask* task = new SweeperTask(isolate, isolate->heap()->old_space(), | 176 SweeperTask* task = new SweeperTask(isolate, isolate->heap()->old_space(), |
172 first, last, freelist); | 177 first, last, freelist); |
173 ThreadPool* pool = Dart::thread_pool(); | 178 ThreadPool* pool = Dart::thread_pool(); |
174 pool->Run(task); | 179 pool->Run(task); |
175 } | 180 } |
176 | 181 |
177 } // namespace dart | 182 } // namespace dart |
OLD | NEW |