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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 static bool ProcessTraceLoadingOption(const char* arg, | 418 static bool ProcessTraceLoadingOption(const char* arg, |
419 CommandLineOptions* vm_options) { | 419 CommandLineOptions* vm_options) { |
420 if (*arg != '\0') { | 420 if (*arg != '\0') { |
421 return false; | 421 return false; |
422 } | 422 } |
423 trace_loading = true; | 423 trace_loading = true; |
424 return true; | 424 return true; |
425 } | 425 } |
426 | 426 |
427 | 427 |
| 428 static bool ProcessHotReloadTestModeOption(const char* arg, |
| 429 CommandLineOptions* vm_options) { |
| 430 if (*arg != '\0') { |
| 431 return false; |
| 432 } |
| 433 |
| 434 // Identity reload. |
| 435 vm_options->AddArgument("--identity_reload"); |
| 436 // Start reloading quickly. |
| 437 vm_options->AddArgument("--reload_every=50"); |
| 438 // Reload from optimized and unoptimized code. |
| 439 vm_options->AddArgument("--reload_every_optimized=false"); |
| 440 // Reload less frequently as time goes on. |
| 441 vm_options->AddArgument("--reload_every_back_off"); |
| 442 // Ensure that an isolate has reloaded once. |
| 443 vm_options->AddArgument("--check_reloaded"); |
| 444 |
| 445 return true; |
| 446 } |
| 447 |
428 | 448 |
429 static bool ProcessShutdownOption(const char* arg, | 449 static bool ProcessShutdownOption(const char* arg, |
430 CommandLineOptions* vm_options) { | 450 CommandLineOptions* vm_options) { |
431 ASSERT(arg != NULL); | 451 ASSERT(arg != NULL); |
432 if (*arg == '\0') { | 452 if (*arg == '\0') { |
433 do_vm_shutdown = true; | 453 do_vm_shutdown = true; |
434 vm_options->AddArgument("--shutdown"); | 454 vm_options->AddArgument("--shutdown"); |
435 return true; | 455 return true; |
436 } | 456 } |
437 | 457 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // VM specific options to the standalone dart program. | 490 // VM specific options to the standalone dart program. |
471 { "--compile_all", ProcessCompileAllOption }, | 491 { "--compile_all", ProcessCompileAllOption }, |
472 { "--enable-vm-service", ProcessEnableVmServiceOption }, | 492 { "--enable-vm-service", ProcessEnableVmServiceOption }, |
473 { "--observe", ProcessObserveOption }, | 493 { "--observe", ProcessObserveOption }, |
474 { "--shutdown", ProcessShutdownOption }, | 494 { "--shutdown", ProcessShutdownOption }, |
475 { "--snapshot=", ProcessSnapshotFilenameOption }, | 495 { "--snapshot=", ProcessSnapshotFilenameOption }, |
476 { "--snapshot-kind=", ProcessSnapshotKindOption }, | 496 { "--snapshot-kind=", ProcessSnapshotKindOption }, |
477 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, | 497 { "--run-app-snapshot=", ProcessRunAppSnapshotOption }, |
478 { "--use-blobs", ProcessUseBlobsOption }, | 498 { "--use-blobs", ProcessUseBlobsOption }, |
479 { "--trace-loading", ProcessTraceLoadingOption }, | 499 { "--trace-loading", ProcessTraceLoadingOption }, |
| 500 { "--hot-reload-test-mode", ProcessHotReloadTestModeOption }, |
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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 Platform::Exit(Process::GlobalExitCode()); | 1769 Platform::Exit(Process::GlobalExitCode()); |
1749 } | 1770 } |
1750 | 1771 |
1751 } // namespace bin | 1772 } // namespace bin |
1752 } // namespace dart | 1773 } // namespace dart |
1753 | 1774 |
1754 int main(int argc, char** argv) { | 1775 int main(int argc, char** argv) { |
1755 dart::bin::main(argc, argv); | 1776 dart::bin::main(argc, argv); |
1756 UNREACHABLE(); | 1777 UNREACHABLE(); |
1757 } | 1778 } |
OLD | NEW |