Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Side by Side Diff: runtime/vm/scavenger.cc

Issue 487023003: vmservice protocol cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 ASSERT(!scavenging_); 837 ASSERT(!scavenging_);
838 ASSERT(from_ == NULL); 838 ASSERT(from_ == NULL);
839 to_->WriteProtect(read_only); 839 to_->WriteProtect(read_only);
840 } 840 }
841 841
842 842
843 void Scavenger::PrintToJSONObject(JSONObject* object) { 843 void Scavenger::PrintToJSONObject(JSONObject* object) {
844 Isolate* isolate = Isolate::Current(); 844 Isolate* isolate = Isolate::Current();
845 ASSERT(isolate != NULL); 845 ASSERT(isolate != NULL);
846 JSONObject space(object, "new"); 846 JSONObject space(object, "new");
847 space.AddProperty("type", "Scavenger"); 847 space.AddProperty("type", "HeapSpace");
848 space.AddProperty("id", "heaps/new"); 848 space.AddProperty("id", "heaps/new");
849 space.AddProperty("name", "Scavenger"); 849 space.AddProperty("name", "new");
850 space.AddProperty("user_name", "new"); 850 space.AddProperty("vmName", "Scavenger");
851 space.AddProperty("collections", collections()); 851 space.AddProperty("collections", collections());
852 if (collections() > 0) { 852 if (collections() > 0) {
853 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time(); 853 int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time();
854 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0)); 854 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0));
855 double run_time_millis = MicrosecondsToMilliseconds(run_time); 855 double run_time_millis = MicrosecondsToMilliseconds(run_time);
856 double avg_time_between_collections = 856 double avg_time_between_collections =
857 run_time_millis / static_cast<double>(collections()); 857 run_time_millis / static_cast<double>(collections());
858 space.AddProperty("avgCollectionPeriodMillis", 858 space.AddProperty("avgCollectionPeriodMillis",
859 avg_time_between_collections); 859 avg_time_between_collections);
860 } else { 860 } else {
(...skipping 12 matching lines...) Expand all
873 } 873 }
874 874
875 875
876 void Scavenger::FreeExternal(intptr_t size) { 876 void Scavenger::FreeExternal(intptr_t size) {
877 ASSERT(size >= 0); 877 ASSERT(size >= 0);
878 external_size_ -= size; 878 external_size_ -= size;
879 ASSERT(external_size_ >= 0); 879 ASSERT(external_size_ >= 0);
880 } 880 }
881 881
882 } // namespace dart 882 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698