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

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

Issue 345543003: Send allocation stats with each class and show in class view. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 4045 matching lines...) Expand 10 before | Expand all | Expand 10 after
4056 } 4056 }
4057 } 4057 }
4058 } 4058 }
4059 { 4059 {
4060 JSONObject typesRef(&jsobj, "canonicalTypes"); 4060 JSONObject typesRef(&jsobj, "canonicalTypes");
4061 typesRef.AddProperty("type", "@TypeList"); 4061 typesRef.AddProperty("type", "@TypeList");
4062 typesRef.AddPropertyF("id", "classes/%" Pd "/types", id()); 4062 typesRef.AddPropertyF("id", "classes/%" Pd "/types", id());
4063 jsobj.AddPropertyF("name", "canonical types of %s", internal_class_name); 4063 jsobj.AddPropertyF("name", "canonical types of %s", internal_class_name);
4064 jsobj.AddPropertyF("user_name", "canonical types of %s", pretty_class_name); 4064 jsobj.AddPropertyF("user_name", "canonical types of %s", pretty_class_name);
4065 } 4065 }
4066 {
4067 ClassTable* class_table = Isolate::Current()->class_table();
4068 const ClassHeapStats* stats = class_table->StatsWithUpdatedSize(id());
4069 if (stats != NULL) {
4070 JSONObject allocation_stats(&jsobj, "allocation_stats");
Cutch 2014/06/20 18:10:49 new service fields use dartCamelCase
koda 2014/06/20 18:37:04 Done.
4071 stats->PrintToJSONObject(*this, &allocation_stats);
4072 }
4073 }
4066 } 4074 }
4067 4075
4068 4076
4069 void Class::InsertCanonicalConstant(intptr_t index, 4077 void Class::InsertCanonicalConstant(intptr_t index,
4070 const Instance& constant) const { 4078 const Instance& constant) const {
4071 // The constant needs to be added to the list. Grow the list if it is full. 4079 // The constant needs to be added to the list. Grow the list if it is full.
4072 Array& canonical_list = Array::Handle(constants()); 4080 Array& canonical_list = Array::Handle(constants());
4073 const intptr_t list_len = canonical_list.Length(); 4081 const intptr_t list_len = canonical_list.Length();
4074 if (index >= list_len) { 4082 if (index >= list_len) {
4075 const intptr_t new_length = (list_len == 0) ? 4 : list_len + 4; 4083 const intptr_t new_length = (list_len == 0) ? 4 : list_len + 4;
(...skipping 14955 matching lines...) Expand 10 before | Expand all | Expand 10 after
19031 return tag_label.ToCString(); 19039 return tag_label.ToCString();
19032 } 19040 }
19033 19041
19034 19042
19035 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19043 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19036 Instance::PrintJSONImpl(stream, ref); 19044 Instance::PrintJSONImpl(stream, ref);
19037 } 19045 }
19038 19046
19039 19047
19040 } // namespace dart 19048 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698