| 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/heap.h" | 5 #include "vm/heap.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 "[ GC(%" Pd64 "): %s(%s), " // GC(isolate), space(reason) | 754 "[ GC(%" Pd64 "): %s(%s), " // GC(isolate), space(reason) |
| 755 "%" Pd ", " // count | 755 "%" Pd ", " // count |
| 756 "%.3f, " // start time | 756 "%.3f, " // start time |
| 757 "%.3f, " // total time | 757 "%.3f, " // total time |
| 758 "%" Pd ", %" Pd ", " // new gen: in use before/after | 758 "%" Pd ", %" Pd ", " // new gen: in use before/after |
| 759 "%" Pd ", %" Pd ", " // new gen: capacity before/after | 759 "%" Pd ", %" Pd ", " // new gen: capacity before/after |
| 760 "%" Pd ", %" Pd ", " // new gen: external before/after | 760 "%" Pd ", %" Pd ", " // new gen: external before/after |
| 761 "%" Pd ", %" Pd ", " // old gen: in use before/after | 761 "%" Pd ", %" Pd ", " // old gen: in use before/after |
| 762 "%" Pd ", %" Pd ", " // old gen: capacity before/after | 762 "%" Pd ", %" Pd ", " // old gen: capacity before/after |
| 763 "%" Pd ", %" Pd ", " // old gen: external before/after | 763 "%" Pd ", %" Pd ", " // old gen: external before/after |
| 764 "%.3f, %.3f, %.3f, %.3f, " // times | 764 "%.3f, %.3f, %.3f, %.3f, %.3f, " // times |
| 765 "%" Pd ", %" Pd ", %" Pd ", %" Pd ", " // data | 765 "%" Pd ", %" Pd ", %" Pd ", %" Pd ", " // data |
| 766 "]\n", // End with a comma to make it easier to import in spreadsheets. | 766 "]\n", // End with a comma to make it easier to import in spreadsheets. |
| 767 isolate()->main_port(), space_str, GCReasonToString(stats_.reason_), | 767 isolate()->main_port(), space_str, GCReasonToString(stats_.reason_), |
| 768 stats_.num_, | 768 stats_.num_, |
| 769 MicrosecondsToSeconds(isolate()->UptimeMicros()), | 769 MicrosecondsToSeconds(isolate()->UptimeMicros()), |
| 770 MicrosecondsToMilliseconds(stats_.after_.micros_ - | 770 MicrosecondsToMilliseconds(stats_.after_.micros_ - |
| 771 stats_.before_.micros_), | 771 stats_.before_.micros_), |
| 772 RoundWordsToKB(stats_.before_.new_.used_in_words), | 772 RoundWordsToKB(stats_.before_.new_.used_in_words), |
| 773 RoundWordsToKB(stats_.after_.new_.used_in_words), | 773 RoundWordsToKB(stats_.after_.new_.used_in_words), |
| 774 RoundWordsToKB(stats_.before_.new_.capacity_in_words), | 774 RoundWordsToKB(stats_.before_.new_.capacity_in_words), |
| 775 RoundWordsToKB(stats_.after_.new_.capacity_in_words), | 775 RoundWordsToKB(stats_.after_.new_.capacity_in_words), |
| 776 RoundWordsToKB(stats_.before_.new_.external_in_words), | 776 RoundWordsToKB(stats_.before_.new_.external_in_words), |
| 777 RoundWordsToKB(stats_.after_.new_.external_in_words), | 777 RoundWordsToKB(stats_.after_.new_.external_in_words), |
| 778 RoundWordsToKB(stats_.before_.old_.used_in_words), | 778 RoundWordsToKB(stats_.before_.old_.used_in_words), |
| 779 RoundWordsToKB(stats_.after_.old_.used_in_words), | 779 RoundWordsToKB(stats_.after_.old_.used_in_words), |
| 780 RoundWordsToKB(stats_.before_.old_.capacity_in_words), | 780 RoundWordsToKB(stats_.before_.old_.capacity_in_words), |
| 781 RoundWordsToKB(stats_.after_.old_.capacity_in_words), | 781 RoundWordsToKB(stats_.after_.old_.capacity_in_words), |
| 782 RoundWordsToKB(stats_.before_.old_.external_in_words), | 782 RoundWordsToKB(stats_.before_.old_.external_in_words), |
| 783 RoundWordsToKB(stats_.after_.old_.external_in_words), | 783 RoundWordsToKB(stats_.after_.old_.external_in_words), |
| 784 MicrosecondsToMilliseconds(stats_.times_[0]), | 784 MicrosecondsToMilliseconds(stats_.times_[0]), |
| 785 MicrosecondsToMilliseconds(stats_.times_[1]), | 785 MicrosecondsToMilliseconds(stats_.times_[1]), |
| 786 MicrosecondsToMilliseconds(stats_.times_[2]), | 786 MicrosecondsToMilliseconds(stats_.times_[2]), |
| 787 MicrosecondsToMilliseconds(stats_.times_[3]), | 787 MicrosecondsToMilliseconds(stats_.times_[3]), |
| 788 MicrosecondsToMilliseconds(stats_.times_[4]), |
| 788 stats_.data_[0], | 789 stats_.data_[0], |
| 789 stats_.data_[1], | 790 stats_.data_[1], |
| 790 stats_.data_[2], | 791 stats_.data_[2], |
| 791 stats_.data_[3]); | 792 stats_.data_[3]); |
| 792 // clang-format on | 793 // clang-format on |
| 793 } | 794 } |
| 794 | 795 |
| 795 | 796 |
| 796 void Heap::PrintStatsToTimeline(TimelineEventScope* event) { | 797 void Heap::PrintStatsToTimeline(TimelineEventScope* event) { |
| 797 #if !defined(PRODUCT) | 798 #if !defined(PRODUCT) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 Dart::vm_isolate()->heap()->WriteProtect(false); | 849 Dart::vm_isolate()->heap()->WriteProtect(false); |
| 849 } | 850 } |
| 850 | 851 |
| 851 | 852 |
| 852 WritableVMIsolateScope::~WritableVMIsolateScope() { | 853 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 853 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 854 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 854 Dart::vm_isolate()->heap()->WriteProtect(true); | 855 Dart::vm_isolate()->heap()->WriteProtect(true); |
| 855 } | 856 } |
| 856 | 857 |
| 857 } // namespace dart | 858 } // namespace dart |
| OLD | NEW |