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_marker.h" | 5 #include "vm/gc_marker.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 399 } |
400 if (!raw_obj->IsOldObject()) { | 400 if (!raw_obj->IsOldObject()) { |
401 return false; | 401 return false; |
402 } | 402 } |
403 return !raw_obj->IsMarked(); | 403 return !raw_obj->IsMarked(); |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 class MarkingWeakVisitor : public HandleVisitor { | 407 class MarkingWeakVisitor : public HandleVisitor { |
408 public: | 408 public: |
409 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) { | 409 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) { |
410 } | 410 } |
411 | 411 |
412 void VisitHandle(uword addr) { | 412 void VisitHandle(uword addr) { |
413 FinalizablePersistentHandle* handle = | 413 FinalizablePersistentHandle* handle = |
414 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 414 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
415 RawObject* raw_obj = handle->raw(); | 415 RawObject* raw_obj = handle->raw(); |
416 if (IsUnreachable(raw_obj)) { | 416 if (IsUnreachable(raw_obj)) { |
417 handle->UpdateUnreachable(isolate()); | 417 handle->UpdateUnreachable(thread()->isolate()); |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
421 private: | 421 private: |
422 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); | 422 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); |
423 }; | 423 }; |
424 | 424 |
425 | 425 |
426 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { | 426 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { |
427 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { | 427 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 barrier.Exit(); | 708 barrier.Exit(); |
709 } | 709 } |
710 delay_set.ClearReferences(); | 710 delay_set.ClearReferences(); |
711 ProcessWeakTables(page_space); | 711 ProcessWeakTables(page_space); |
712 ProcessObjectIdTable(isolate); | 712 ProcessObjectIdTable(isolate); |
713 } | 713 } |
714 Epilogue(isolate, invoke_api_callbacks); | 714 Epilogue(isolate, invoke_api_callbacks); |
715 } | 715 } |
716 | 716 |
717 } // namespace dart | 717 } // namespace dart |
OLD | NEW |