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

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

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 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
« no previous file with comments | « runtime/vm/scavenger.h ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « runtime/vm/scavenger.h ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698