OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/pages.h" | 5 #include "vm/pages.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/gc_marker.h" | 8 #include "vm/gc_marker.h" |
9 #include "vm/gc_sweeper.h" | 9 #include "vm/gc_sweeper.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 return Object::null(); | 256 return Object::null(); |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 void PageSpace::MarkSweep(bool invoke_api_callbacks) { | 260 void PageSpace::MarkSweep(bool invoke_api_callbacks) { |
261 // MarkSweep is not reentrant. Make sure that is the case. | 261 // MarkSweep is not reentrant. Make sure that is the case. |
262 ASSERT(!sweeping_); | 262 ASSERT(!sweeping_); |
263 sweeping_ = true; | 263 sweeping_ = true; |
264 Isolate* isolate = Isolate::Current(); | 264 Isolate* isolate = Isolate::Current(); |
265 NoHandleScope no_handles(isolate); | 265 NOHANDLESCOPE(isolate); |
266 | 266 |
267 if (FLAG_verify_before_gc) { | 267 if (FLAG_verify_before_gc) { |
268 OS::PrintErr("Verifying before MarkSweep... "); | 268 OS::PrintErr("Verifying before MarkSweep... "); |
269 heap_->Verify(); | 269 heap_->Verify(); |
270 OS::PrintErr(" done.\n"); | 270 OS::PrintErr(" done.\n"); |
271 } | 271 } |
272 | 272 |
273 Timer timer(FLAG_verbose_gc, "MarkSweep"); | 273 Timer timer(FLAG_verbose_gc, "MarkSweep"); |
274 timer.Start(); | 274 timer.Start(); |
275 | 275 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 OS::PrintErr(" done.\n"); | 327 OS::PrintErr(" done.\n"); |
328 } | 328 } |
329 | 329 |
330 count_++; | 330 count_++; |
331 // Done, reset the marker. | 331 // Done, reset the marker. |
332 ASSERT(sweeping_); | 332 ASSERT(sweeping_); |
333 sweeping_ = false; | 333 sweeping_ = false; |
334 } | 334 } |
335 | 335 |
336 } // namespace dart | 336 } // namespace dart |
OLD | NEW |