| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 vm_options->AddArgument("--reload_every_back_off"); | 469 vm_options->AddArgument("--reload_every_back_off"); |
| 470 // Ensure that every isolate has reloaded once before exiting. | 470 // Ensure that every isolate has reloaded once before exiting. |
| 471 vm_options->AddArgument("--check_reloaded"); | 471 vm_options->AddArgument("--check_reloaded"); |
| 472 // Force all reloads to fail and execute the rollback code. | 472 // Force all reloads to fail and execute the rollback code. |
| 473 vm_options->AddArgument("--reload_force_rollback"); | 473 vm_options->AddArgument("--reload_force_rollback"); |
| 474 | 474 |
| 475 return true; | 475 return true; |
| 476 } | 476 } |
| 477 | 477 |
| 478 | 478 |
| 479 extern bool short_socket_read; |
| 480 |
| 481 extern bool short_socket_write; |
| 482 |
| 483 static bool ProcessShortSocketReadOption(const char* arg, |
| 484 CommandLineOptions* vm_options) { |
| 485 short_socket_read = true; |
| 486 return true; |
| 487 } |
| 488 |
| 489 |
| 490 static bool ProcessShortSocketWriteOption(const char* arg, |
| 491 CommandLineOptions* vm_options) { |
| 492 short_socket_write = true; |
| 493 return true; |
| 494 } |
| 495 |
| 496 |
| 479 static struct { | 497 static struct { |
| 480 const char* option_name; | 498 const char* option_name; |
| 481 bool (*process)(const char* option, CommandLineOptions* vm_options); | 499 bool (*process)(const char* option, CommandLineOptions* vm_options); |
| 482 } main_options[] = { | 500 } main_options[] = { |
| 483 // Standard options shared with dart2js. | 501 // Standard options shared with dart2js. |
| 484 { "-D", ProcessEnvironmentOption }, | 502 { "-D", ProcessEnvironmentOption }, |
| 485 { "-h", ProcessHelpOption }, | 503 { "-h", ProcessHelpOption }, |
| 486 { "--help", ProcessHelpOption }, | 504 { "--help", ProcessHelpOption }, |
| 487 { "--packages=", ProcessPackagesOption }, | 505 { "--packages=", ProcessPackagesOption }, |
| 488 { "--package-root=", ProcessPackageRootOption }, | 506 { "--package-root=", ProcessPackageRootOption }, |
| 489 { "-v", ProcessVerboseOption }, | 507 { "-v", ProcessVerboseOption }, |
| 490 { "--verbose", ProcessVerboseOption }, | 508 { "--verbose", ProcessVerboseOption }, |
| 491 { "--version", ProcessVersionOption }, | 509 { "--version", ProcessVersionOption }, |
| 492 | 510 |
| 493 // VM specific options to the standalone dart program. | 511 // VM specific options to the standalone dart program. |
| 494 { "--compile_all", ProcessCompileAllOption }, | 512 { "--compile_all", ProcessCompileAllOption }, |
| 495 { "--enable-vm-service", ProcessEnableVmServiceOption }, | 513 { "--enable-vm-service", ProcessEnableVmServiceOption }, |
| 496 { "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption }, | 514 { "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption }, |
| 497 { "--observe", ProcessObserveOption }, | 515 { "--observe", ProcessObserveOption }, |
| 498 { "--snapshot=", ProcessSnapshotFilenameOption }, | 516 { "--snapshot=", ProcessSnapshotFilenameOption }, |
| 499 { "--snapshot-kind=", ProcessSnapshotKindOption }, | 517 { "--snapshot-kind=", ProcessSnapshotKindOption }, |
| 500 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, | 518 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, |
| 501 { "--use-blobs", ProcessUseBlobsOption }, | 519 { "--use-blobs", ProcessUseBlobsOption }, |
| 502 { "--trace-loading", ProcessTraceLoadingOption }, | 520 { "--trace-loading", ProcessTraceLoadingOption }, |
| 503 { "--hot-reload-test-mode", ProcessHotReloadTestModeOption }, | 521 { "--hot-reload-test-mode", ProcessHotReloadTestModeOption }, |
| 504 { "--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption }, | 522 { "--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption }, |
| 523 { "--short_socket_read", ProcessShortSocketReadOption }, |
| 524 { "--short_socket_write", ProcessShortSocketWriteOption }, |
| 505 { NULL, NULL } | 525 { NULL, NULL } |
| 506 }; | 526 }; |
| 507 | 527 |
| 508 | 528 |
| 509 static bool ProcessMainOptions(const char* option, | 529 static bool ProcessMainOptions(const char* option, |
| 510 CommandLineOptions* vm_options) { | 530 CommandLineOptions* vm_options) { |
| 511 int i = 0; | 531 int i = 0; |
| 512 const char* name = main_options[0].option_name; | 532 const char* name = main_options[0].option_name; |
| 513 int option_length = strlen(option); | 533 int option_length = strlen(option); |
| 514 while (name != NULL) { | 534 while (name != NULL) { |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 Platform::Exit(Process::GlobalExitCode()); | 1817 Platform::Exit(Process::GlobalExitCode()); |
| 1798 } | 1818 } |
| 1799 | 1819 |
| 1800 } // namespace bin | 1820 } // namespace bin |
| 1801 } // namespace dart | 1821 } // namespace dart |
| 1802 | 1822 |
| 1803 int main(int argc, char** argv) { | 1823 int main(int argc, char** argv) { |
| 1804 dart::bin::main(argc, argv); | 1824 dart::bin::main(argc, argv); |
| 1805 UNREACHABLE(); | 1825 UNREACHABLE(); |
| 1806 } | 1826 } |
| OLD | NEW |