| 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 const intptr_t task_index_; | 659 const intptr_t task_index_; |
| 660 const intptr_t num_tasks_; | 660 const intptr_t num_tasks_; |
| 661 uintptr_t* num_busy_; | 661 uintptr_t* num_busy_; |
| 662 | 662 |
| 663 DISALLOW_COPY_AND_ASSIGN(MarkTask); | 663 DISALLOW_COPY_AND_ASSIGN(MarkTask); |
| 664 }; | 664 }; |
| 665 | 665 |
| 666 | 666 |
| 667 template<class MarkingVisitorType> | 667 template<class MarkingVisitorType> |
| 668 void GCMarker::FinalizeResultsFrom(MarkingVisitorType* visitor) { | 668 void GCMarker::FinalizeResultsFrom(MarkingVisitorType* visitor) { |
| 669 #ifndef PRODUCT |
| 669 { | 670 { |
| 670 MutexLocker ml(&stats_mutex_); | 671 MutexLocker ml(&stats_mutex_); |
| 671 marked_bytes_ += visitor->marked_bytes(); | 672 marked_bytes_ += visitor->marked_bytes(); |
| 672 // Class heap stats are not themselves thread-safe yet, so we update the | 673 // Class heap stats are not themselves thread-safe yet, so we update the |
| 673 // stats while holding stats_mutex_. | 674 // stats while holding stats_mutex_. |
| 674 ClassTable* table = heap_->isolate()->class_table(); | 675 ClassTable* table = heap_->isolate()->class_table(); |
| 675 for (intptr_t i = 0; i < table->NumCids(); ++i) { | 676 for (intptr_t i = 0; i < table->NumCids(); ++i) { |
| 676 const intptr_t count = visitor->live_count(i); | 677 const intptr_t count = visitor->live_count(i); |
| 677 if (count > 0) { | 678 if (count > 0) { |
| 678 const intptr_t size = visitor->live_size(i); | 679 const intptr_t size = visitor->live_size(i); |
| 679 table->UpdateLiveOld(i, size, count); | 680 table->UpdateLiveOld(i, size, count); |
| 680 } | 681 } |
| 681 } | 682 } |
| 682 } | 683 } |
| 684 #endif // !PRODUCT |
| 683 visitor->Finalize(); | 685 visitor->Finalize(); |
| 684 } | 686 } |
| 685 | 687 |
| 686 | 688 |
| 687 void GCMarker::MarkObjects(Isolate* isolate, | 689 void GCMarker::MarkObjects(Isolate* isolate, |
| 688 PageSpace* page_space, | 690 PageSpace* page_space, |
| 689 bool invoke_api_callbacks, | 691 bool invoke_api_callbacks, |
| 690 bool collect_code) { | 692 bool collect_code) { |
| 691 Prologue(isolate, invoke_api_callbacks); | 693 Prologue(isolate, invoke_api_callbacks); |
| 692 // The API prologue/epilogue may create/destroy zones, so we must not | 694 // The API prologue/epilogue may create/destroy zones, so we must not |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // Phase 3: Finalize results from all markers (detach code, etc.). | 777 // Phase 3: Finalize results from all markers (detach code, etc.). |
| 776 barrier.Exit(); | 778 barrier.Exit(); |
| 777 } | 779 } |
| 778 ProcessWeakTables(page_space); | 780 ProcessWeakTables(page_space); |
| 779 ProcessObjectIdTable(isolate); | 781 ProcessObjectIdTable(isolate); |
| 780 } | 782 } |
| 781 Epilogue(isolate, invoke_api_callbacks); | 783 Epilogue(isolate, invoke_api_callbacks); |
| 782 } | 784 } |
| 783 | 785 |
| 784 } // namespace dart | 786 } // namespace dart |
| OLD | NEW |