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 "vm/allocation.h" | 7 #include "vm/allocation.h" |
8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/log.h" | 10 #include "vm/log.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 class MarkingWeakVisitor : public HandleVisitor { | 423 class MarkingWeakVisitor : public HandleVisitor { |
424 public: | 424 public: |
425 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) { | 425 MarkingWeakVisitor() : HandleVisitor(Thread::Current()) { |
426 } | 426 } |
427 | 427 |
428 void VisitHandle(uword addr) { | 428 void VisitHandle(uword addr) { |
429 FinalizablePersistentHandle* handle = | 429 FinalizablePersistentHandle* handle = |
430 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 430 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
431 RawObject* raw_obj = handle->raw(); | 431 RawObject* raw_obj = handle->raw(); |
432 if (IsUnreachable(raw_obj)) { | 432 if (IsUnreachable(raw_obj)) { |
433 handle->UpdateUnreachable(thread()->isolate()); | 433 handle->UpdateUnreachableFinalizeNow(thread()->isolate()); |
siva
2016/06/02 20:18:05
Why is this finalization done eagerly inline and n
rmacnak
2016/06/03 01:08:30
Added background finalization here too.
| |
434 } | 434 } |
435 } | 435 } |
436 | 436 |
437 private: | 437 private: |
438 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); | 438 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); |
439 }; | 439 }; |
440 | 440 |
441 | 441 |
442 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { | 442 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { |
443 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { | 443 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
701 // Phase 3: Finalize results from all markers (detach code, etc.). | 701 // Phase 3: Finalize results from all markers (detach code, etc.). |
702 barrier.Exit(); | 702 barrier.Exit(); |
703 } | 703 } |
704 ProcessWeakTables(page_space); | 704 ProcessWeakTables(page_space); |
705 ProcessObjectIdTable(isolate); | 705 ProcessObjectIdTable(isolate); |
706 } | 706 } |
707 Epilogue(isolate, invoke_api_callbacks); | 707 Epilogue(isolate, invoke_api_callbacks); |
708 } | 708 } |
709 | 709 |
710 } // namespace dart | 710 } // namespace dart |
OLD | NEW |