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 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 | 1456 |
| 1457 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { | 1457 static bool HandleAllocationProfile(Isolate* isolate, JSONStream* js) { |
| 1458 if (js->num_arguments() == 2) { | 1458 if (js->num_arguments() == 2) { |
| 1459 const char* sub_command = js->GetArgument(1); | 1459 const char* sub_command = js->GetArgument(1); |
| 1460 if (!strcmp(sub_command, "reset")) { | 1460 if (!strcmp(sub_command, "reset")) { |
| 1461 isolate->class_table()->ResetAllocationAccumulators(); | 1461 isolate->class_table()->ResetAllocationAccumulators(); |
| 1462 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | 1462 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
| 1463 return true; | 1463 return true; |
| 1464 } else if (!strcmp(sub_command, "fullgc")) { | |
|
Ivan Posva
2014/03/25 21:20:43
We need a better way to pass parameters to the di
turnidge
2014/03/25 22:02:50
This feels more like an option than a subcommand t
| |
| 1465 isolate->heap()->CollectAllGarbage(); | |
| 1466 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | |
| 1467 return true; | |
| 1464 } else { | 1468 } else { |
| 1465 PrintError(js, "Unrecognized subcommand '%s'", sub_command); | 1469 PrintError(js, "Unrecognized subcommand '%s'", sub_command); |
| 1466 return true; | 1470 return true; |
| 1467 } | 1471 } |
| 1468 } | 1472 } |
| 1469 if (js->num_arguments() != 1) { | 1473 if (js->num_arguments() != 1) { |
| 1470 PrintError(js, "Command too long"); | 1474 PrintError(js, "Command too long"); |
| 1471 return true; | 1475 return true; |
| 1472 } | 1476 } |
| 1473 isolate->class_table()->AllocationProfilePrintToJSONStream(js); | 1477 isolate->class_table()->AllocationProfilePrintToJSONStream(js); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1876 while (current != NULL) { | 1880 while (current != NULL) { |
| 1877 if (strcmp(name, current->name()) == 0) { | 1881 if (strcmp(name, current->name()) == 0) { |
| 1878 return current; | 1882 return current; |
| 1879 } | 1883 } |
| 1880 current = current->next(); | 1884 current = current->next(); |
| 1881 } | 1885 } |
| 1882 return NULL; | 1886 return NULL; |
| 1883 } | 1887 } |
| 1884 | 1888 |
| 1885 } // namespace dart | 1889 } // namespace dart |
| OLD | NEW |