| 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/scavenger.h" | 5 #include "vm/scavenger.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 ASSERT(!scavenging_); | 825 ASSERT(!scavenging_); |
| 826 ASSERT(from_ == NULL); | 826 ASSERT(from_ == NULL); |
| 827 to_->WriteProtect(read_only); | 827 to_->WriteProtect(read_only); |
| 828 } | 828 } |
| 829 | 829 |
| 830 | 830 |
| 831 void Scavenger::PrintToJSONObject(JSONObject* object) { | 831 void Scavenger::PrintToJSONObject(JSONObject* object) { |
| 832 Isolate* isolate = Isolate::Current(); | 832 Isolate* isolate = Isolate::Current(); |
| 833 ASSERT(isolate != NULL); | 833 ASSERT(isolate != NULL); |
| 834 JSONObject space(object, "new"); | 834 JSONObject space(object, "new"); |
| 835 space.AddProperty("type", "Scavenger"); | 835 space.AddProperty("type", "HeapSpace"); |
| 836 space.AddProperty("id", "heaps/new"); | 836 space.AddProperty("id", "heaps/new"); |
| 837 space.AddProperty("name", "Scavenger"); | 837 space.AddProperty("name", "new"); |
| 838 space.AddProperty("user_name", "new"); | 838 space.AddProperty("vmName", "Scavenger"); |
| 839 space.AddProperty("collections", collections()); | 839 space.AddProperty("collections", collections()); |
| 840 if (collections() > 0) { | 840 if (collections() > 0) { |
| 841 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); | 841 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); |
| 842 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); | 842 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); |
| 843 double run_time_millis = MicrosecondsToMilliseconds(run_time); | 843 double run_time_millis = MicrosecondsToMilliseconds(run_time); |
| 844 double avg_time_between_collections = | 844 double avg_time_between_collections = |
| 845 run_time_millis / static_cast<double>(collections()); | 845 run_time_millis / static_cast<double>(collections()); |
| 846 space.AddProperty("avgCollectionPeriodMillis", | 846 space.AddProperty("avgCollectionPeriodMillis", |
| 847 avg_time_between_collections); | 847 avg_time_between_collections); |
| 848 } else { | 848 } else { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 861 } | 861 } |
| 862 | 862 |
| 863 | 863 |
| 864 void Scavenger::FreeExternal(intptr_t size) { | 864 void Scavenger::FreeExternal(intptr_t size) { |
| 865 ASSERT(size >= 0); | 865 ASSERT(size >= 0); |
| 866 external_size_ -= size; | 866 external_size_ -= size; |
| 867 ASSERT(external_size_ >= 0); | 867 ASSERT(external_size_ >= 0); |
| 868 } | 868 } |
| 869 | 869 |
| 870 } // namespace dart | 870 } // namespace dart |
| OLD | NEW |