OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 CHECK_RESULT(result); | 719 CHECK_RESULT(result); |
720 | 720 |
721 // Run event-loop and wait for script loading to complete. | 721 // Run event-loop and wait for script loading to complete. |
722 result = Dart_RunLoop(); | 722 result = Dart_RunLoop(); |
723 CHECK_RESULT(result); | 723 CHECK_RESULT(result); |
724 | 724 |
725 if (isolate_data->load_async_id >= 0) { | 725 if (isolate_data->load_async_id >= 0) { |
726 Dart_TimelineAsyncEnd("LoadScript", isolate_data->load_async_id); | 726 Dart_TimelineAsyncEnd("LoadScript", isolate_data->load_async_id); |
727 } | 727 } |
728 | 728 |
729 Platform::SetPackageRoot(package_root); | |
730 | |
731 DartUtils::SetupIOLibrary(script_uri); | 729 DartUtils::SetupIOLibrary(script_uri); |
732 | 730 |
733 // Make the isolate runnable so that it is ready to handle messages. | 731 // Make the isolate runnable so that it is ready to handle messages. |
734 Dart_ExitScope(); | 732 Dart_ExitScope(); |
735 Dart_ExitIsolate(); | 733 Dart_ExitIsolate(); |
736 bool retval = Dart_IsolateMakeRunnable(isolate); | 734 bool retval = Dart_IsolateMakeRunnable(isolate); |
737 if (!retval) { | 735 if (!retval) { |
738 *error = strdup("Invalid isolate state - Unable to make it runnable"); | 736 *error = strdup("Invalid isolate state - Unable to make it runnable"); |
739 Dart_EnterIsolate(isolate); | 737 Dart_EnterIsolate(isolate); |
740 Dart_ShutdownIsolate(); | 738 Dart_ShutdownIsolate(); |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 exit(Process::GlobalExitCode()); | 1309 exit(Process::GlobalExitCode()); |
1312 } | 1310 } |
1313 | 1311 |
1314 } // namespace bin | 1312 } // namespace bin |
1315 } // namespace dart | 1313 } // namespace dart |
1316 | 1314 |
1317 int main(int argc, char** argv) { | 1315 int main(int argc, char** argv) { |
1318 dart::bin::main(argc, argv); | 1316 dart::bin::main(argc, argv); |
1319 UNREACHABLE(); | 1317 UNREACHABLE(); |
1320 } | 1318 } |
OLD | NEW |