| 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_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 // closures and setting up 'package root' for URI resolution. | 540 // closures and setting up 'package root' for URI resolution. |
| 541 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); | 541 result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib); |
| 542 CHECK_RESULT(result); | 542 CHECK_RESULT(result); |
| 543 | 543 |
| 544 IsolateData* isolate_data = reinterpret_cast<IsolateData*>(data); | 544 IsolateData* isolate_data = reinterpret_cast<IsolateData*>(data); |
| 545 ASSERT(isolate_data != NULL); | 545 ASSERT(isolate_data != NULL); |
| 546 ASSERT(isolate_data->script_url != NULL); | 546 ASSERT(isolate_data->script_url != NULL); |
| 547 result = DartUtils::LoadScript(isolate_data->script_url, builtin_lib); | 547 result = DartUtils::LoadScript(isolate_data->script_url, builtin_lib); |
| 548 CHECK_RESULT(result); | 548 CHECK_RESULT(result); |
| 549 | 549 |
| 550 result = Dart_RunLoop(); | 550 if (Dart_IsVMFlagSet("load_async")) { |
| 551 CHECK_RESULT(result); | 551 result = Dart_RunLoop(); |
| 552 CHECK_RESULT(result); |
| 553 } |
| 552 | 554 |
| 553 Platform::SetPackageRoot(package_root); | 555 Platform::SetPackageRoot(package_root); |
| 554 Dart_Handle io_lib_url = DartUtils::NewString(DartUtils::kIOLibURL); | 556 Dart_Handle io_lib_url = DartUtils::NewString(DartUtils::kIOLibURL); |
| 555 CHECK_RESULT(io_lib_url); | 557 CHECK_RESULT(io_lib_url); |
| 556 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); | 558 Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url); |
| 557 CHECK_RESULT(io_lib); | 559 CHECK_RESULT(io_lib); |
| 558 Dart_Handle platform_type = DartUtils::GetDartType(DartUtils::kIOLibURL, | 560 Dart_Handle platform_type = DartUtils::GetDartType(DartUtils::kIOLibURL, |
| 559 "Platform"); | 561 "Platform"); |
| 560 CHECK_RESULT(platform_type); | 562 CHECK_RESULT(platform_type); |
| 561 Dart_Handle script_name = DartUtils::NewString("_nativeScript"); | 563 Dart_Handle script_name = DartUtils::NewString("_nativeScript"); |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 exit(Process::GlobalExitCode()); | 1129 exit(Process::GlobalExitCode()); |
| 1128 } | 1130 } |
| 1129 | 1131 |
| 1130 } // namespace bin | 1132 } // namespace bin |
| 1131 } // namespace dart | 1133 } // namespace dart |
| 1132 | 1134 |
| 1133 int main(int argc, char** argv) { | 1135 int main(int argc, char** argv) { |
| 1134 dart::bin::main(argc, argv); | 1136 dart::bin::main(argc, argv); |
| 1135 UNREACHABLE(); | 1137 UNREACHABLE(); |
| 1136 } | 1138 } |
| OLD | NEW |