OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 &vm_options, | 296 &vm_options, |
297 &script_name, | 297 &script_name, |
298 &dart_options) < 0) { | 298 &dart_options) < 0) { |
299 PrintUsage(); | 299 PrintUsage(); |
300 return 255; | 300 return 255; |
301 } | 301 } |
302 | 302 |
303 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 303 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
304 | 304 |
305 // Initialize the Dart VM. | 305 // Initialize the Dart VM. |
306 Dart_Initialize(CreateIsolateAndSetup); | 306 Dart_Initialize(CreateIsolateAndSetup, NULL); |
307 | 307 |
308 canonical_script_name = File::GetCanonicalPath(script_name); | 308 canonical_script_name = File::GetCanonicalPath(script_name); |
309 if (canonical_script_name == NULL) { | 309 if (canonical_script_name == NULL) { |
310 fprintf(stderr, "Unable to find '%s'\n", script_name); | 310 fprintf(stderr, "Unable to find '%s'\n", script_name); |
311 return 255; // Indicates we encountered an error. | 311 return 255; // Indicates we encountered an error. |
312 } | 312 } |
313 | 313 |
314 // Call CreateIsolateAndSetup which creates an isolate and loads up | 314 // Call CreateIsolateAndSetup which creates an isolate and loads up |
315 // the specified application script. | 315 // the specified application script. |
316 char* error = NULL; | 316 char* error = NULL; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 return 255; // Indicates we encountered an error. | 409 return 255; // Indicates we encountered an error. |
410 } | 410 } |
411 free(canonical_script_name); | 411 free(canonical_script_name); |
412 Dart_ExitScope(); | 412 Dart_ExitScope(); |
413 // Dump symbol information for the profiler. | 413 // Dump symbol information for the profiler. |
414 DumpPprofSymbolInfo(); | 414 DumpPprofSymbolInfo(); |
415 // Shutdown the isolate. | 415 // Shutdown the isolate. |
416 Dart_ShutdownIsolate(); | 416 Dart_ShutdownIsolate(); |
417 return 0; | 417 return 0; |
418 } | 418 } |
OLD | NEW |