| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Generate a snapshot file after loading all the scripts specified on the | 5 // Generate a snapshot file after loading all the scripts specified on the |
| 6 // command line. | 6 // command line. |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); | 508 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); |
| 509 | 509 |
| 510 // Initialize the Dart VM. | 510 // Initialize the Dart VM. |
| 511 // Note: We don't expect isolates to be created from dart code during | 511 // Note: We don't expect isolates to be created from dart code during |
| 512 // snapshot generation. | 512 // snapshot generation. |
| 513 if (!Dart_Initialize(NULL, NULL, NULL, NULL, | 513 if (!Dart_Initialize(NULL, NULL, NULL, NULL, |
| 514 DartUtils::OpenFile, | 514 DartUtils::OpenFile, |
| 515 DartUtils::ReadFile, | 515 DartUtils::ReadFile, |
| 516 DartUtils::WriteFile, | 516 DartUtils::WriteFile, |
| 517 DartUtils::CloseFile, | 517 DartUtils::CloseFile, |
| 518 DartUtils::EntropySource)) { | 518 DartUtils::EntropySource, |
| 519 NULL)) { |
| 519 Log::PrintErr("VM initialization failed\n"); | 520 Log::PrintErr("VM initialization failed\n"); |
| 520 return 255; | 521 return 255; |
| 521 } | 522 } |
| 522 | 523 |
| 523 char* error; | 524 char* error; |
| 524 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error); | 525 Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error); |
| 525 if (isolate == NULL) { | 526 if (isolate == NULL) { |
| 526 Log::PrintErr("Error: %s", error); | 527 Log::PrintErr("Error: %s", error); |
| 527 free(error); | 528 free(error); |
| 528 exit(255); | 529 exit(255); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } | 589 } |
| 589 return 0; | 590 return 0; |
| 590 } | 591 } |
| 591 | 592 |
| 592 } // namespace bin | 593 } // namespace bin |
| 593 } // namespace dart | 594 } // namespace dart |
| 594 | 595 |
| 595 int main(int argc, char** argv) { | 596 int main(int argc, char** argv) { |
| 596 return dart::bin::main(argc, argv); | 597 return dart::bin::main(argc, argv); |
| 597 } | 598 } |
| OLD | NEW |