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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary); | 461 LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary); |
462 VerifyLoaded(library); | 462 VerifyLoaded(library); |
463 } | 463 } |
464 | 464 |
465 | 465 |
466 static void SetupForGenericSnapshotCreation() { | 466 static void SetupForGenericSnapshotCreation() { |
467 SetupForUriResolution(); | 467 SetupForUriResolution(); |
468 | 468 |
469 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); | 469 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); |
470 VerifyLoaded(library); | 470 VerifyLoaded(library); |
| 471 Dart_Handle result = Dart_FinalizeLoading(false); |
| 472 if (Dart_IsError(result)) { |
| 473 const char* err_msg = Dart_GetError(library); |
| 474 Log::PrintErr("Errors encountered while loading: %s\n", err_msg); |
| 475 Dart_ExitScope(); |
| 476 Dart_ShutdownIsolate(); |
| 477 exit(255); |
| 478 } |
471 } | 479 } |
472 | 480 |
473 | 481 |
474 int main(int argc, char** argv) { | 482 int main(int argc, char** argv) { |
475 CommandLineOptions vm_options(argc); | 483 CommandLineOptions vm_options(argc); |
476 | 484 |
477 // Initialize the URL mapping array. | 485 // Initialize the URL mapping array. |
478 CommandLineOptions url_mapping_array(argc); | 486 CommandLineOptions url_mapping_array(argc); |
479 url_mapping = &url_mapping_array; | 487 url_mapping = &url_mapping_array; |
480 | 488 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 574 } |
567 return 0; | 575 return 0; |
568 } | 576 } |
569 | 577 |
570 } // namespace bin | 578 } // namespace bin |
571 } // namespace dart | 579 } // namespace dart |
572 | 580 |
573 int main(int argc, char** argv) { | 581 int main(int argc, char** argv) { |
574 return dart::bin::main(argc, argv); | 582 return dart::bin::main(argc, argv); |
575 } | 583 } |
OLD | NEW |