| 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_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 } | 648 } |
| 649 | 649 |
| 650 if (has_help_option) { | 650 if (has_help_option) { |
| 651 PrintUsage(); | 651 PrintUsage(); |
| 652 return 0; | 652 return 0; |
| 653 } | 653 } |
| 654 | 654 |
| 655 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 655 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
| 656 | 656 |
| 657 // Initialize the Dart VM. | 657 // Initialize the Dart VM. |
| 658 Dart_Initialize(CreateIsolateAndSetup, | 658 if (!Dart_Initialize(CreateIsolateAndSetup, |
| 659 NULL, | 659 NULL, |
| 660 ShutdownIsolate); | 660 ShutdownIsolate)) { |
| 661 return ErrorExit("VM initialization failed\n"); |
| 662 } |
| 661 | 663 |
| 662 DartUtils::SetOriginalWorkingDirectory(); | 664 DartUtils::SetOriginalWorkingDirectory(); |
| 663 | 665 |
| 664 // Call CreateIsolateAndSetup which creates an isolate and loads up | 666 // Call CreateIsolateAndSetup which creates an isolate and loads up |
| 665 // the specified application script. | 667 // the specified application script. |
| 666 char* error = NULL; | 668 char* error = NULL; |
| 667 char* isolate_name = BuildIsolateName(script_name, "main"); | 669 char* isolate_name = BuildIsolateName(script_name, "main"); |
| 668 if (!CreateIsolateAndSetupHelper(script_name, | 670 if (!CreateIsolateAndSetupHelper(script_name, |
| 669 "main", | 671 "main", |
| 670 true, // Canonicalize the script name. | 672 true, // Canonicalize the script name. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 Dart_ExitScope(); | 734 Dart_ExitScope(); |
| 733 // Dump symbol information for the profiler. | 735 // Dump symbol information for the profiler. |
| 734 DumpPprofSymbolInfo(); | 736 DumpPprofSymbolInfo(); |
| 735 // Shutdown the isolate. | 737 // Shutdown the isolate. |
| 736 Dart_ShutdownIsolate(); | 738 Dart_ShutdownIsolate(); |
| 737 // Terminate process exit-code handler. | 739 // Terminate process exit-code handler. |
| 738 Process::TerminateExitCodeHandler(); | 740 Process::TerminateExitCodeHandler(); |
| 739 | 741 |
| 740 return 0; | 742 return 0; |
| 741 } | 743 } |
| OLD | NEW |