| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 vm_options->AddArgument("--reload_every_optimized=false"); | 445 vm_options->AddArgument("--reload_every_optimized=false"); |
| 446 // Reload less frequently as time goes on. | 446 // Reload less frequently as time goes on. |
| 447 vm_options->AddArgument("--reload_every_back_off"); | 447 vm_options->AddArgument("--reload_every_back_off"); |
| 448 // Ensure that every isolate has reloaded once before exiting. | 448 // Ensure that every isolate has reloaded once before exiting. |
| 449 vm_options->AddArgument("--check_reloaded"); | 449 vm_options->AddArgument("--check_reloaded"); |
| 450 | 450 |
| 451 return true; | 451 return true; |
| 452 } | 452 } |
| 453 | 453 |
| 454 | 454 |
| 455 static bool ProcessHotReloadRollbackTestModeOption( |
| 456 const char* arg, |
| 457 CommandLineOptions* vm_options) { |
| 458 // Identity reload. |
| 459 vm_options->AddArgument("--identity_reload"); |
| 460 // Start reloading quickly. |
| 461 vm_options->AddArgument("--reload_every=4"); |
| 462 // Reload from optimized and unoptimized code. |
| 463 vm_options->AddArgument("--reload_every_optimized=false"); |
| 464 // Reload less frequently as time goes on. |
| 465 vm_options->AddArgument("--reload_every_back_off"); |
| 466 // Ensure that every isolate has reloaded once before exiting. |
| 467 vm_options->AddArgument("--check_reloaded"); |
| 468 // Force all reloads to fail and execute the rollback code. |
| 469 vm_options->AddArgument("--reload_force_rollback"); |
| 470 |
| 471 return true; |
| 472 } |
| 473 |
| 474 |
| 455 static struct { | 475 static struct { |
| 456 const char* option_name; | 476 const char* option_name; |
| 457 bool (*process)(const char* option, CommandLineOptions* vm_options); | 477 bool (*process)(const char* option, CommandLineOptions* vm_options); |
| 458 } main_options[] = { | 478 } main_options[] = { |
| 459 // Standard options shared with dart2js. | 479 // Standard options shared with dart2js. |
| 460 { "-D", ProcessEnvironmentOption }, | 480 { "-D", ProcessEnvironmentOption }, |
| 461 { "-h", ProcessHelpOption }, | 481 { "-h", ProcessHelpOption }, |
| 462 { "--help", ProcessHelpOption }, | 482 { "--help", ProcessHelpOption }, |
| 463 { "--packages=", ProcessPackagesOption }, | 483 { "--packages=", ProcessPackagesOption }, |
| 464 { "--package-root=", ProcessPackageRootOption }, | 484 { "--package-root=", ProcessPackageRootOption }, |
| 465 { "-v", ProcessVerboseOption }, | 485 { "-v", ProcessVerboseOption }, |
| 466 { "--verbose", ProcessVerboseOption }, | 486 { "--verbose", ProcessVerboseOption }, |
| 467 { "--version", ProcessVersionOption }, | 487 { "--version", ProcessVersionOption }, |
| 468 | 488 |
| 469 // VM specific options to the standalone dart program. | 489 // VM specific options to the standalone dart program. |
| 470 { "--compile_all", ProcessCompileAllOption }, | 490 { "--compile_all", ProcessCompileAllOption }, |
| 471 { "--enable-vm-service", ProcessEnableVmServiceOption }, | 491 { "--enable-vm-service", ProcessEnableVmServiceOption }, |
| 472 { "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption }, | 492 { "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption }, |
| 473 { "--observe", ProcessObserveOption }, | 493 { "--observe", ProcessObserveOption }, |
| 474 { "--snapshot=", ProcessSnapshotFilenameOption }, | 494 { "--snapshot=", ProcessSnapshotFilenameOption }, |
| 475 { "--snapshot-kind=", ProcessSnapshotKindOption }, | 495 { "--snapshot-kind=", ProcessSnapshotKindOption }, |
| 476 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, | 496 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, |
| 477 { "--use-blobs", ProcessUseBlobsOption }, | 497 { "--use-blobs", ProcessUseBlobsOption }, |
| 478 { "--trace-loading", ProcessTraceLoadingOption }, | 498 { "--trace-loading", ProcessTraceLoadingOption }, |
| 479 { "--hot-reload-test-mode", ProcessHotReloadTestModeOption }, | 499 { "--hot-reload-test-mode", ProcessHotReloadTestModeOption }, |
| 500 { "--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption }, |
| 480 { NULL, NULL } | 501 { NULL, NULL } |
| 481 }; | 502 }; |
| 482 | 503 |
| 483 | 504 |
| 484 static bool ProcessMainOptions(const char* option, | 505 static bool ProcessMainOptions(const char* option, |
| 485 CommandLineOptions* vm_options) { | 506 CommandLineOptions* vm_options) { |
| 486 int i = 0; | 507 int i = 0; |
| 487 const char* name = main_options[0].option_name; | 508 const char* name = main_options[0].option_name; |
| 488 int option_length = strlen(option); | 509 int option_length = strlen(option); |
| 489 while (name != NULL) { | 510 while (name != NULL) { |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1766 Platform::Exit(Process::GlobalExitCode()); | 1787 Platform::Exit(Process::GlobalExitCode()); |
| 1767 } | 1788 } |
| 1768 | 1789 |
| 1769 } // namespace bin | 1790 } // namespace bin |
| 1770 } // namespace dart | 1791 } // namespace dart |
| 1771 | 1792 |
| 1772 int main(int argc, char** argv) { | 1793 int main(int argc, char** argv) { |
| 1773 dart::bin::main(argc, argv); | 1794 dart::bin::main(argc, argv); |
| 1774 UNREACHABLE(); | 1795 UNREACHABLE(); |
| 1775 } | 1796 } |
| OLD | NEW |