| 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 return true; | 1079 return true; |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { | 1082 static bool HandleCoverage(Isolate* isolate, JSONStream* js) { |
| 1083 CodeCoverage::PrintToJSONStream(isolate, js); | 1083 CodeCoverage::PrintToJSONStream(isolate, js); |
| 1084 return true; | 1084 return true; |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 | 1087 |
| 1088 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { | 1088 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { |
| 1089 if (js->num_arguments() == 2) { |
| 1090 const char* sub_command = js->GetArgument(1); |
| 1091 if (!strcmp(sub_command, "reset")) { |
| 1092 isolate->class_table()->ResetAllocationAccumulators(); |
| 1093 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
| 1094 return true; |
| 1095 } else { |
| 1096 PrintError(js, "Unrecognized subcommand '%s'", sub_command); |
| 1097 return true; |
| 1098 } |
| 1099 } |
| 1100 if (js->num_arguments() != 1) { |
| 1101 PrintError(js, "Command too long"); |
| 1102 return true; |
| 1103 } |
| 1089 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | 1104 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
| 1090 return true; | 1105 return true; |
| 1091 } | 1106 } |
| 1092 | 1107 |
| 1093 | 1108 |
| 1094 static bool HandleUnpin(Isolate* isolate, JSONStream* js) { | 1109 static bool HandleUnpin(Isolate* isolate, JSONStream* js) { |
| 1095 // TODO(johnmccutchan): What do I respond with?? | 1110 // TODO(johnmccutchan): What do I respond with?? |
| 1096 isolate->ClosePinPort(); | 1111 isolate->ClosePinPort(); |
| 1097 return true; | 1112 return true; |
| 1098 } | 1113 } |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 while (current != NULL) { | 1341 while (current != NULL) { |
| 1327 if (!strcmp(name, current->name())) { | 1342 if (!strcmp(name, current->name())) { |
| 1328 return current; | 1343 return current; |
| 1329 } | 1344 } |
| 1330 current = current->next(); | 1345 current = current->next(); |
| 1331 } | 1346 } |
| 1332 return NULL; | 1347 return NULL; |
| 1333 } | 1348 } |
| 1334 | 1349 |
| 1335 } // namespace dart | 1350 } // namespace dart |
| OLD | NEW |