| 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 | 10 |
| 11 #include "bin/builtin.h" | 11 #include "bin/builtin.h" |
| 12 #include "bin/dartutils.h" | 12 #include "bin/dartutils.h" |
| 13 #include "bin/file.h" | 13 #include "bin/file.h" |
| 14 #include "bin/globals.h" | 14 #include "bin/globals.h" |
| 15 #include "bin/platform.h" |
| 15 | 16 |
| 16 // snapshot_buffer points to a snapshot if we link in a snapshot otherwise | 17 // snapshot_buffer points to a snapshot if we link in a snapshot otherwise |
| 17 // it is initialized to NULL. | 18 // it is initialized to NULL. |
| 18 extern const uint8_t* snapshot_buffer; | 19 extern const uint8_t* snapshot_buffer; |
| 19 | 20 |
| 20 | 21 |
| 21 // Global state that indicates whether pprof symbol information is | 22 // Global state that indicates whether pprof symbol information is |
| 22 // to be generated or not. | 23 // to be generated or not. |
| 23 static const char* generate_pprof_symbols_filename = NULL; | 24 static const char* generate_pprof_symbols_filename = NULL; |
| 24 | 25 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 245 } |
| 245 return false; | 246 return false; |
| 246 } | 247 } |
| 247 | 248 |
| 248 | 249 |
| 249 int main(int argc, char** argv) { | 250 int main(int argc, char** argv) { |
| 250 char* script_name; | 251 char* script_name; |
| 251 CommandLineOptions vm_options(argc); | 252 CommandLineOptions vm_options(argc); |
| 252 CommandLineOptions dart_options(argc); | 253 CommandLineOptions dart_options(argc); |
| 253 | 254 |
| 255 // Perform platform specific initialization. |
| 256 if (!Platform::Initialize()) { |
| 257 fprintf(stderr, "Initialization failed\n"); |
| 258 } |
| 259 |
| 254 // Parse command line arguments. | 260 // Parse command line arguments. |
| 255 if (ParseArguments(argc, | 261 if (ParseArguments(argc, |
| 256 argv, | 262 argv, |
| 257 &vm_options, | 263 &vm_options, |
| 258 &script_name, | 264 &script_name, |
| 259 &dart_options) < 0) { | 265 &dart_options) < 0) { |
| 260 PrintUsage(); | 266 PrintUsage(); |
| 261 return 255; | 267 return 255; |
| 262 } | 268 } |
| 263 | 269 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return 255; // Indicates we encountered an error. | 347 return 255; // Indicates we encountered an error. |
| 342 } | 348 } |
| 343 free(canonical_script_name); | 349 free(canonical_script_name); |
| 344 Dart_ExitScope(); | 350 Dart_ExitScope(); |
| 345 // Dump symbol information for the profiler. | 351 // Dump symbol information for the profiler. |
| 346 DumpPprofSymbolInfo(); | 352 DumpPprofSymbolInfo(); |
| 347 // Shutdown the isolate. | 353 // Shutdown the isolate. |
| 348 Dart_ShutdownIsolate(); | 354 Dart_ShutdownIsolate(); |
| 349 return 0; | 355 return 0; |
| 350 } | 356 } |
| OLD | NEW |