| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 // Get the executable name. | 172 // Get the executable name. |
| 173 *executable_name = argv[0]; | 173 *executable_name = argv[0]; |
| 174 | 174 |
| 175 // Start the rest after the executable name. | 175 // Start the rest after the executable name. |
| 176 int i = 1; | 176 int i = 1; |
| 177 | 177 |
| 178 // Parse out the vm options. | 178 // Parse out the vm options. |
| 179 while ((i < argc) && IsValidFlag(argv[i], kPrefix, kPrefixLen)) { | 179 while ((i < argc) && IsValidFlag(argv[i], kPrefix, kPrefixLen)) { |
| 180 if (ProcessMainOptions(argv[i])) { | 180 if (ProcessMainOptions(argv[i])) { |
| 181 ++i; | 181 i++; |
| 182 } else { | 182 } else { |
| 183 vm_options->AddArgument(argv[i]); | 183 vm_options->AddArgument(argv[i]); |
| 184 ++i; | 184 i++; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 if (generate_pprof_symbols_filename != NULL) { | 187 if (generate_pprof_symbols_filename != NULL) { |
| 188 Dart_InitPprofSupport(); | 188 Dart_InitPprofSupport(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Get the script name. | 191 // Get the script name. |
| 192 if (i < argc) { | 192 if (i < argc) { |
| 193 *script_name = argv[i]; | 193 *script_name = argv[i]; |
| 194 ++i; | 194 i++; |
| 195 } else { | 195 } else { |
| 196 return -1; | 196 return -1; |
| 197 } | 197 } |
| 198 | 198 |
| 199 // Parse out options to be passed to dart main. | 199 // Parse out options to be passed to dart main. |
| 200 while (i < argc) { | 200 while (i < argc) { |
| 201 dart_options->AddArgument(argv[i]); | 201 dart_options->AddArgument(argv[i]); |
| 202 i += 1; | 202 i++; |
| 203 } | 203 } |
| 204 | 204 |
| 205 return 0; | 205 return 0; |
| 206 } | 206 } |
| 207 | 207 |
| 208 | 208 |
| 209 static Dart_Handle SetupRuntimeOptions(CommandLineOptions* options, | 209 static Dart_Handle SetupRuntimeOptions(CommandLineOptions* options, |
| 210 const char* executable_name, | 210 const char* executable_name, |
| 211 const char* script_name) { | 211 const char* script_name) { |
| 212 int options_count = options->count(); | 212 int options_count = options->count(); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 Dart_ShutdownIsolate(); | 693 Dart_ShutdownIsolate(); |
| 694 // Terminate process exit-code handler. | 694 // Terminate process exit-code handler. |
| 695 Process::TerminateExitCodeHandler(); | 695 Process::TerminateExitCodeHandler(); |
| 696 | 696 |
| 697 free(const_cast<char*>(original_script_name)); | 697 free(const_cast<char*>(original_script_name)); |
| 698 free(const_cast<char*>(original_working_directory)); | 698 free(const_cast<char*>(original_working_directory)); |
| 699 free(const_cast<char*>(original_script_url)); | 699 free(const_cast<char*>(original_script_url)); |
| 700 | 700 |
| 701 return 0; | 701 return 0; |
| 702 } | 702 } |
| OLD | NEW |