| 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 "vm/dart.h" | 7 #include "vm/dart.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/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 return; | 865 return; |
| 866 } | 866 } |
| 867 Isolate* isolate = Isolate::Current(); | 867 Isolate* isolate = Isolate::Current(); |
| 868 ASSERT(isolate != NULL); | 868 ASSERT(isolate != NULL); |
| 869 JSONObject space(object, "new"); | 869 JSONObject space(object, "new"); |
| 870 space.AddProperty("type", "HeapSpace"); | 870 space.AddProperty("type", "HeapSpace"); |
| 871 space.AddProperty("name", "new"); | 871 space.AddProperty("name", "new"); |
| 872 space.AddProperty("vmName", "Scavenger"); | 872 space.AddProperty("vmName", "Scavenger"); |
| 873 space.AddProperty("collections", collections()); | 873 space.AddProperty("collections", collections()); |
| 874 if (collections() > 0) { | 874 if (collections() > 0) { |
| 875 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); | 875 int64_t run_time = isolate->UptimeMicros(); |
| 876 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); | 876 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); |
| 877 double run_time_millis = MicrosecondsToMilliseconds(run_time); | 877 double run_time_millis = MicrosecondsToMilliseconds(run_time); |
| 878 double avg_time_between_collections = | 878 double avg_time_between_collections = |
| 879 run_time_millis / static_cast<double>(collections()); | 879 run_time_millis / static_cast<double>(collections()); |
| 880 space.AddProperty("avgCollectionPeriodMillis", | 880 space.AddProperty("avgCollectionPeriodMillis", |
| 881 avg_time_between_collections); | 881 avg_time_between_collections); |
| 882 } else { | 882 } else { |
| 883 space.AddProperty("avgCollectionPeriodMillis", 0.0); | 883 space.AddProperty("avgCollectionPeriodMillis", 0.0); |
| 884 } | 884 } |
| 885 space.AddProperty64("used", UsedInWords() * kWordSize); | 885 space.AddProperty64("used", UsedInWords() * kWordSize); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 896 } | 896 } |
| 897 | 897 |
| 898 | 898 |
| 899 void Scavenger::FreeExternal(intptr_t size) { | 899 void Scavenger::FreeExternal(intptr_t size) { |
| 900 ASSERT(size >= 0); | 900 ASSERT(size >= 0); |
| 901 external_size_ -= size; | 901 external_size_ -= size; |
| 902 ASSERT(external_size_ >= 0); | 902 ASSERT(external_size_ >= 0); |
| 903 } | 903 } |
| 904 | 904 |
| 905 } // namespace dart | 905 } // namespace dart |
| OLD | NEW |