| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 if (!raw_obj->IsOldObject()) { | 457 if (!raw_obj->IsOldObject()) { |
| 458 return false; | 458 return false; |
| 459 } | 459 } |
| 460 return !raw_obj->IsMarked(); | 460 return !raw_obj->IsMarked(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 | 463 |
| 464 class MarkingWeakVisitor : public HandleVisitor { | 464 class MarkingWeakVisitor : public HandleVisitor { |
| 465 public: | 465 public: |
| 466 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) { | 466 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) { |
| 467 } | 467 } |
| 468 | 468 |
| 469 void VisitHandle(uword addr) { | 469 void VisitHandle(uword addr) { |
| 470 FinalizablePersistentHandle* handle = | 470 FinalizablePersistentHandle* handle = |
| 471 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 471 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
| 472 RawObject* raw_obj = handle->raw(); | 472 RawObject* raw_obj = handle->raw(); |
| 473 if (IsUnreachable(raw_obj)) { | 473 if (IsUnreachable(raw_obj)) { |
| 474 handle->UpdateUnreachable(isolate()); | 474 handle->UpdateUnreachable(thread()->isolate()); |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 private: | 478 private: |
| 479 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); | 479 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); |
| 480 }; | 480 }; |
| 481 | 481 |
| 482 | 482 |
| 483 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { | 483 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { |
| 484 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { | 484 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 barrier.Exit(); | 818 barrier.Exit(); |
| 819 } | 819 } |
| 820 delay_set.ClearReferences(); | 820 delay_set.ClearReferences(); |
| 821 ProcessWeakTables(page_space); | 821 ProcessWeakTables(page_space); |
| 822 ProcessObjectIdTable(isolate); | 822 ProcessObjectIdTable(isolate); |
| 823 } | 823 } |
| 824 Epilogue(isolate, invoke_api_callbacks); | 824 Epilogue(isolate, invoke_api_callbacks); |
| 825 } | 825 } |
| 826 | 826 |
| 827 } // namespace dart | 827 } // namespace dart |
| OLD | NEW |