Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1070 return true; | 1070 return true; |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { | 1073 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { |
| 1074 CodeCoverage::PrintToJSONStream(isolate, js); | 1074 CodeCoverage::PrintToJSONStream(isolate, js); |
| 1075 return true; | 1075 return true; |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 | 1078 |
| 1079 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { | 1079 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { |
| 1080 if (js->num_arguments() == 2) { | |
| 1081 const char* sub_command = js->GetArgument(1); | |
| 1082 if (!strcmp(sub_command, "reset")) { | |
| 1083 isolate->class_table()->ResetAllocationAccumulators(); | |
| 1084 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | |
| 1085 return true; | |
| 1086 } else { | |
| 1087 PrintError(js, "Unrecognized subcommand '%s'", sub_command); | |
| 1088 return true; | |
|
turnidge
2014/02/27 18:29:13
Add a heartbeat test. I don't care if it is simpl
Cutch
2014/02/27 21:50:33
Done.
| |
| 1089 } | |
| 1090 } | |
| 1091 if (js->num_arguments() != 1) { | |
| 1092 PrintError(js, "Command too long"); | |
| 1093 return true; | |
| 1094 } | |
| 1080 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | 1095 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
| 1081 return true; | 1096 return true; |
| 1082 } | 1097 } |
| 1083 | 1098 |
| 1084 | 1099 |
| 1085 static IsolateMessageHandlerEntry isolate_handlers[] = { | 1100 static IsolateMessageHandlerEntry isolate_handlers[] = { |
| 1086 { "_echo", HandleIsolateEcho }, | 1101 { "_echo", HandleIsolateEcho }, |
| 1087 { "", HandleIsolate }, | 1102 { "", HandleIsolate }, |
| 1088 { "allocationprofile", HandleAllocationProfile }, | 1103 { "allocationprofile", HandleAllocationProfile }, |
| 1089 { "classes", HandleClasses }, | 1104 { "classes", HandleClasses }, |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1308 while (current != NULL) { | 1323 while (current != NULL) { |
| 1309 if (!strcmp(name, current->name())) { | 1324 if (!strcmp(name, current->name())) { |
| 1310 return current; | 1325 return current; |
| 1311 } | 1326 } |
| 1312 current = current->next(); | 1327 current = current->next(); |
| 1313 } | 1328 } |
| 1314 return NULL; | 1329 return NULL; |
| 1315 } | 1330 } |
| 1316 | 1331 |
| 1317 } // namespace dart | 1332 } // namespace dart |
| OLD | NEW |