| 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/pages.h" | 5 #include "vm/pages.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/compiler_stats.h" | 8 #include "vm/compiler_stats.h" |
| 9 #include "vm/gc_marker.h" | 9 #include "vm/gc_marker.h" |
| 10 #include "vm/gc_sweeper.h" | 10 #include "vm/gc_sweeper.h" |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 space.AddProperty("avgCollectionPeriodMillis", | 691 space.AddProperty("avgCollectionPeriodMillis", |
| 692 avg_time_between_collections); | 692 avg_time_between_collections); |
| 693 } else { | 693 } else { |
| 694 space.AddProperty("avgCollectionPeriodMillis", 0.0); | 694 space.AddProperty("avgCollectionPeriodMillis", 0.0); |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 | 697 |
| 698 | 698 |
| 699 class HeapMapAsJSONVisitor : public ObjectVisitor { | 699 class HeapMapAsJSONVisitor : public ObjectVisitor { |
| 700 public: | 700 public: |
| 701 explicit HeapMapAsJSONVisitor(JSONArray* array) | 701 explicit HeapMapAsJSONVisitor(JSONArray* array) : array_(array) { } |
| 702 : ObjectVisitor(NULL), array_(array) {} | |
| 703 virtual void VisitObject(RawObject* obj) { | 702 virtual void VisitObject(RawObject* obj) { |
| 704 array_->AddValue(obj->Size() / kObjectAlignment); | 703 array_->AddValue(obj->Size() / kObjectAlignment); |
| 705 array_->AddValue(obj->GetClassId()); | 704 array_->AddValue(obj->GetClassId()); |
| 706 } | 705 } |
| 707 private: | 706 private: |
| 708 JSONArray* array_; | 707 JSONArray* array_; |
| 709 }; | 708 }; |
| 710 | 709 |
| 711 | 710 |
| 712 void PageSpace::PrintHeapMapToJSONStream( | 711 void PageSpace::PrintHeapMapToJSONStream( |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 return 0; | 1229 return 0; |
| 1231 } else { | 1230 } else { |
| 1232 ASSERT(total_time >= gc_time); | 1231 ASSERT(total_time >= gc_time); |
| 1233 int result = static_cast<int>((static_cast<double>(gc_time) / | 1232 int result = static_cast<int>((static_cast<double>(gc_time) / |
| 1234 static_cast<double>(total_time)) * 100); | 1233 static_cast<double>(total_time)) * 100); |
| 1235 return result; | 1234 return result; |
| 1236 } | 1235 } |
| 1237 } | 1236 } |
| 1238 | 1237 |
| 1239 } // namespace dart | 1238 } // namespace dart |
| OLD | NEW |