| 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // Ensure that we mark all libraries as loaded. | 580 // Ensure that we mark all libraries as loaded. |
| 581 result = Dart_FinalizeLoading(false); | 581 result = Dart_FinalizeLoading(false); |
| 582 CHECK_RESULT(result); | 582 CHECK_RESULT(result); |
| 583 | 583 |
| 584 // Prepare for script loading by setting up the 'print' and 'timer' | 584 // Prepare for script loading by setting up the 'print' and 'timer' |
| 585 // closures and setting up 'package root' for URI resolution. | 585 // closures and setting up 'package root' for URI resolution. |
| 586 result = | 586 result = |
| 587 DartUtils::PrepareForScriptLoading(package_root, false, builtin_lib); | 587 DartUtils::PrepareForScriptLoading(package_root, false, builtin_lib); |
| 588 CHECK_RESULT(result); | 588 CHECK_RESULT(result); |
| 589 Dart_ExitScope(); | 589 Dart_ExitScope(); |
| 590 Dart_ExitIsolate(); |
| 590 | 591 |
| 591 UriResolverIsolateScope::isolate = isolate; | 592 UriResolverIsolateScope::isolate = isolate; |
| 592 | 593 |
| 593 // Now we create an isolate into which we load all the code that needs to | 594 // Now we create an isolate into which we load all the code that needs to |
| 594 // be in the snapshot. | 595 // be in the snapshot. |
| 595 if (Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error) == NULL) { | 596 if (Dart_CreateIsolate(NULL, NULL, NULL, NULL, &error) == NULL) { |
| 596 fprintf(stderr, "%s", error); | 597 fprintf(stderr, "%s", error); |
| 597 free(error); | 598 free(error); |
| 598 exit(255); | 599 exit(255); |
| 599 } | 600 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 619 } | 620 } |
| 620 return 0; | 621 return 0; |
| 621 } | 622 } |
| 622 | 623 |
| 623 } // namespace bin | 624 } // namespace bin |
| 624 } // namespace dart | 625 } // namespace dart |
| 625 | 626 |
| 626 int main(int argc, char** argv) { | 627 int main(int argc, char** argv) { |
| 627 return dart::bin::main(argc, argv); | 628 return dart::bin::main(argc, argv); |
| 628 } | 629 } |
| OLD | NEW |