| 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 <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 exit(kErrorExitCode); | 1543 exit(kErrorExitCode); |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 Dart_Handle result; | 1546 Dart_Handle result; |
| 1547 Dart_Handle library; | 1547 Dart_Handle library; |
| 1548 Dart_EnterScope(); | 1548 Dart_EnterScope(); |
| 1549 | 1549 |
| 1550 result = Dart_SetEnvironmentCallback(EnvironmentCallback); | 1550 result = Dart_SetEnvironmentCallback(EnvironmentCallback); |
| 1551 CHECK_RESULT(result); | 1551 CHECK_RESULT(result); |
| 1552 | 1552 |
| 1553 ASSERT(vm_snapshot_data_filename != NULL); | |
| 1554 ASSERT(isolate_snapshot_data_filename != NULL); | |
| 1555 // Load up the script before a snapshot is created. | 1553 // Load up the script before a snapshot is created. |
| 1556 if (app_script_name != NULL) { | 1554 if (app_script_name != NULL) { |
| 1557 // This is the case of a custom embedder (e.g: dartium) trying to | 1555 // This is the case of a custom embedder (e.g: dartium) trying to |
| 1558 // create a full snapshot. The current isolate is set up so that we can | 1556 // create a full snapshot. The current isolate is set up so that we can |
| 1559 // invoke the dart uri resolution code like _resolveURI. App script is | 1557 // invoke the dart uri resolution code like _resolveURI. App script is |
| 1560 // loaded into a separate isolate. | 1558 // loaded into a separate isolate. |
| 1561 SetupForUriResolution(); | 1559 SetupForUriResolution(); |
| 1562 | 1560 |
| 1563 // Prepare builtin and its dependent libraries for use to resolve URIs. | 1561 // Prepare builtin and its dependent libraries for use to resolve URIs. |
| 1564 // Set up various closures, e.g: printing, timers etc. | 1562 // Set up various closures, e.g: printing, timers etc. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 delete mapped_isolate_snapshot_data; | 1692 delete mapped_isolate_snapshot_data; |
| 1695 return 0; | 1693 return 0; |
| 1696 } | 1694 } |
| 1697 | 1695 |
| 1698 } // namespace bin | 1696 } // namespace bin |
| 1699 } // namespace dart | 1697 } // namespace dart |
| 1700 | 1698 |
| 1701 int main(int argc, char** argv) { | 1699 int main(int argc, char** argv) { |
| 1702 return dart::bin::main(argc, argv); | 1700 return dart::bin::main(argc, argv); |
| 1703 } | 1701 } |
| OLD | NEW |