| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 ASSERT(from_ == NULL); | 865 ASSERT(from_ == NULL); |
| 866 to_->WriteProtect(read_only); | 866 to_->WriteProtect(read_only); |
| 867 } | 867 } |
| 868 | 868 |
| 869 | 869 |
| 870 void Scavenger::PrintToJSONObject(JSONObject* object) { | 870 void Scavenger::PrintToJSONObject(JSONObject* object) { |
| 871 Isolate* isolate = Isolate::Current(); | 871 Isolate* isolate = Isolate::Current(); |
| 872 ASSERT(isolate != NULL); | 872 ASSERT(isolate != NULL); |
| 873 JSONObject space(object, "new"); | 873 JSONObject space(object, "new"); |
| 874 space.AddProperty("type", "HeapSpace"); | 874 space.AddProperty("type", "HeapSpace"); |
| 875 space.AddProperty("id", "heaps/new"); | |
| 876 space.AddProperty("name", "new"); | 875 space.AddProperty("name", "new"); |
| 877 space.AddProperty("vmName", "Scavenger"); | 876 space.AddProperty("vmName", "Scavenger"); |
| 878 space.AddProperty("collections", collections()); | 877 space.AddProperty("collections", collections()); |
| 879 if (collections() > 0) { | 878 if (collections() > 0) { |
| 880 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); | 879 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); |
| 881 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); | 880 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); |
| 882 double run_time_millis = MicrosecondsToMilliseconds(run_time); | 881 double run_time_millis = MicrosecondsToMilliseconds(run_time); |
| 883 double avg_time_between_collections = | 882 double avg_time_between_collections = |
| 884 run_time_millis / static_cast<double>(collections()); | 883 run_time_millis / static_cast<double>(collections()); |
| 885 space.AddProperty("avgCollectionPeriodMillis", | 884 space.AddProperty("avgCollectionPeriodMillis", |
| (...skipping 14 matching lines...) Expand all Loading... |
| 900 } | 899 } |
| 901 | 900 |
| 902 | 901 |
| 903 void Scavenger::FreeExternal(intptr_t size) { | 902 void Scavenger::FreeExternal(intptr_t size) { |
| 904 ASSERT(size >= 0); | 903 ASSERT(size >= 0); |
| 905 external_size_ -= size; | 904 external_size_ -= size; |
| 906 ASSERT(external_size_ >= 0); | 905 ASSERT(external_size_ >= 0); |
| 907 } | 906 } |
| 908 | 907 |
| 909 } // namespace dart | 908 } // namespace dart |
| OLD | NEW |