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