| 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 Dart_Handle root_lib = Dart_RootLibrary(); | 1487 Dart_Handle root_lib = Dart_RootLibrary(); |
| 1488 // Import the root library into the builtin library so that we can easily | 1488 // Import the root library into the builtin library so that we can easily |
| 1489 // lookup the main entry point exported from the root library. | 1489 // lookup the main entry point exported from the root library. |
| 1490 IsolateData* isolate_data = | 1490 IsolateData* isolate_data = |
| 1491 reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate)); | 1491 reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate)); |
| 1492 result = Dart_LibraryImportLibrary(isolate_data->builtin_lib(), root_lib, | 1492 result = Dart_LibraryImportLibrary(isolate_data->builtin_lib(), root_lib, |
| 1493 Dart_Null()); | 1493 Dart_Null()); |
| 1494 if ((gen_snapshot_kind == kAppAOT) || (gen_snapshot_kind == kAppJIT)) { | 1494 if ((gen_snapshot_kind == kAppAOT) || (gen_snapshot_kind == kAppJIT)) { |
| 1495 // Load the embedder's portion of the VM service's Dart code so it will | 1495 // Load the embedder's portion of the VM service's Dart code so it will |
| 1496 // be included in the app snapshot. | 1496 // be included in the app snapshot. |
| 1497 if (!VmService::LoadForGenPrecompiled()) { | 1497 #if defined(DART_PRECOMPILED_RUNTIME) |
| 1498 if (!VmService::LoadForGenPrecompiled(NULL)) { |
| 1499 #else |
| 1500 if (!VmService::LoadForGenPrecompiled(dfe.kernel_vmservice_io())) { |
| 1501 #endif // defined(DART_PRECOMPILED_RUNTIME) |
| 1498 Log::PrintErr("VM service loading failed: %s\n", | 1502 Log::PrintErr("VM service loading failed: %s\n", |
| 1499 VmService::GetErrorMessage()); | 1503 VmService::GetErrorMessage()); |
| 1500 exit(kErrorExitCode); | 1504 exit(kErrorExitCode); |
| 1501 } | 1505 } |
| 1502 } | 1506 } |
| 1503 | 1507 |
| 1504 if (compile_all) { | 1508 if (compile_all) { |
| 1505 result = Dart_CompileAll(); | 1509 result = Dart_CompileAll(); |
| 1506 CHECK_RESULT(result); | 1510 CHECK_RESULT(result); |
| 1507 } | 1511 } |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 Platform::Exit(Process::GlobalExitCode()); | 1955 Platform::Exit(Process::GlobalExitCode()); |
| 1952 } | 1956 } |
| 1953 | 1957 |
| 1954 } // namespace bin | 1958 } // namespace bin |
| 1955 } // namespace dart | 1959 } // namespace dart |
| 1956 | 1960 |
| 1957 int main(int argc, char** argv) { | 1961 int main(int argc, char** argv) { |
| 1958 dart::bin::main(argc, argv); | 1962 dart::bin::main(argc, argv); |
| 1959 UNREACHABLE(); | 1963 UNREACHABLE(); |
| 1960 } | 1964 } |
| OLD | NEW |