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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | 1089 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
1090 return true; | 1090 return true; |
1091 } | 1091 } |
1092 | 1092 |
1093 | 1093 |
| 1094 static bool HandleUnpin(Isolate* isolate, JSONStream* js) { |
| 1095 // TODO(johnmccutchan): What do I respond with?? |
| 1096 isolate->ClosePinPort(); |
| 1097 return true; |
| 1098 } |
| 1099 |
| 1100 |
1094 static IsolateMessageHandlerEntry isolate_handlers[] = { | 1101 static IsolateMessageHandlerEntry isolate_handlers[] = { |
1095 { "_echo", HandleIsolateEcho }, | 1102 { "_echo", HandleIsolateEcho }, |
1096 { "", HandleIsolate }, | 1103 { "", HandleIsolate }, |
1097 { "allocationprofile", HandleAllocationProfile }, | 1104 { "allocationprofile", HandleAllocationProfile }, |
1098 { "classes", HandleClasses }, | 1105 { "classes", HandleClasses }, |
1099 { "code", HandleCode }, | 1106 { "code", HandleCode }, |
1100 { "coverage", HandleCoverage }, | 1107 { "coverage", HandleCoverage }, |
1101 { "cpu", HandleCpu }, | 1108 { "cpu", HandleCpu }, |
1102 { "debug", HandleDebug }, | 1109 { "debug", HandleDebug }, |
1103 { "libraries", HandleLibraries }, | 1110 { "libraries", HandleLibraries }, |
1104 { "objecthistogram", HandleObjectHistogram}, | 1111 { "objecthistogram", HandleObjectHistogram}, |
1105 { "objects", HandleObjects }, | 1112 { "objects", HandleObjects }, |
1106 { "profile", HandleProfile }, | 1113 { "profile", HandleProfile }, |
| 1114 { "unpin", HandleUnpin }, |
1107 { "scripts", HandleScripts }, | 1115 { "scripts", HandleScripts }, |
1108 { "stacktrace", HandleStackTrace }, | 1116 { "stacktrace", HandleStackTrace }, |
1109 }; | 1117 }; |
1110 | 1118 |
1111 | 1119 |
1112 static IsolateMessageHandler FindIsolateMessageHandler(const char* command) { | 1120 static IsolateMessageHandler FindIsolateMessageHandler(const char* command) { |
1113 intptr_t num_message_handlers = sizeof(isolate_handlers) / | 1121 intptr_t num_message_handlers = sizeof(isolate_handlers) / |
1114 sizeof(isolate_handlers[0]); | 1122 sizeof(isolate_handlers[0]); |
1115 for (intptr_t i = 0; i < num_message_handlers; i++) { | 1123 for (intptr_t i = 0; i < num_message_handlers; i++) { |
1116 const IsolateMessageHandlerEntry& entry = isolate_handlers[i]; | 1124 const IsolateMessageHandlerEntry& entry = isolate_handlers[i]; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 while (current != NULL) { | 1326 while (current != NULL) { |
1319 if (!strcmp(name, current->name())) { | 1327 if (!strcmp(name, current->name())) { |
1320 return current; | 1328 return current; |
1321 } | 1329 } |
1322 current = current->next(); | 1330 current = current->next(); |
1323 } | 1331 } |
1324 return NULL; | 1332 return NULL; |
1325 } | 1333 } |
1326 | 1334 |
1327 } // namespace dart | 1335 } // namespace dart |
OLD | NEW |