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

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

Issue 204103009: Add class and address information to heap map; display on hover. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/service_test.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/coverage.h" 10 #include "vm/coverage.h"
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 return true; 958 return true;
959 } 959 }
960 type.PrintToJSONStream(js, false); 960 type.PrintToJSONStream(js, false);
961 return true; 961 return true;
962 } 962 }
963 963
964 964
965 static bool HandleClasses(Isolate* isolate, JSONStream* js) { 965 static bool HandleClasses(Isolate* isolate, JSONStream* js) {
966 if (js->num_arguments() == 1) { 966 if (js->num_arguments() == 1) {
967 ClassTable* table = isolate->class_table(); 967 ClassTable* table = isolate->class_table();
968 table->PrintToJSONStream(js); 968 JSONObject jsobj(js);
969 table->PrintToJSONObject(&jsobj);
969 return true; 970 return true;
970 } 971 }
971 ASSERT(js->num_arguments() >= 2); 972 ASSERT(js->num_arguments() >= 2);
972 intptr_t id; 973 intptr_t id;
973 if (!GetIntegerId(js->GetArgument(1), &id)) { 974 if (!GetIntegerId(js->GetArgument(1), &id)) {
974 PrintError(js, "Must specify collection object id: /classes/id"); 975 PrintError(js, "Must specify collection object id: /classes/id");
975 return true; 976 return true;
976 } 977 }
977 ClassTable* table = isolate->class_table(); 978 ClassTable* table = isolate->class_table();
978 if (!table->IsValidIndex(id)) { 979 if (!table->IsValidIndex(id)) {
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 PrintError(js, "%" Pd " is not a valid typearguments id.", id); 1527 PrintError(js, "%" Pd " is not a valid typearguments id.", id);
1527 return true; 1528 return true;
1528 } 1529 }
1529 type_args ^= table.At(id); 1530 type_args ^= table.At(id);
1530 type_args.PrintToJSONStream(js, false); 1531 type_args.PrintToJSONStream(js, false);
1531 return true; 1532 return true;
1532 } 1533 }
1533 1534
1534 1535
1535 static bool HandleHeapMap(Isolate* isolate, JSONStream* js) { 1536 static bool HandleHeapMap(Isolate* isolate, JSONStream* js) {
1536 isolate->heap()->PrintHeapMapToJSONStream(js); 1537 isolate->heap()->PrintHeapMapToJSONStream(isolate, js);
1537 return true; 1538 return true;
1538 } 1539 }
1539 1540
1540 1541
1541 static IsolateMessageHandlerEntry isolate_handlers[] = { 1542 static IsolateMessageHandlerEntry isolate_handlers[] = {
1542 { "_echo", HandleIsolateEcho }, 1543 { "_echo", HandleIsolateEcho },
1543 { "", HandleIsolate }, 1544 { "", HandleIsolate },
1544 { "allocationprofile", HandleAllocationProfile }, 1545 { "allocationprofile", HandleAllocationProfile },
1545 { "classes", HandleClasses }, 1546 { "classes", HandleClasses },
1546 { "code", HandleCode }, 1547 { "code", HandleCode },
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 while (current != NULL) { 1768 while (current != NULL) {
1768 if (strcmp(name, current->name()) == 0) { 1769 if (strcmp(name, current->name()) == 0) {
1769 return current; 1770 return current;
1770 } 1771 }
1771 current = current->next(); 1772 current = current->next();
1772 } 1773 }
1773 return NULL; 1774 return NULL;
1774 } 1775 }
1775 1776
1776 } // namespace dart 1777 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698