| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 } else { | 1186 } else { |
| 1187 // Lookup the library of the root script. | 1187 // Lookup the library of the root script. |
| 1188 Dart_Handle root_lib = Dart_RootLibrary(); | 1188 Dart_Handle root_lib = Dart_RootLibrary(); |
| 1189 // Import the root library into the builtin library so that we can easily | 1189 // Import the root library into the builtin library so that we can easily |
| 1190 // lookup the main entry point exported from the root library. | 1190 // lookup the main entry point exported from the root library. |
| 1191 Dart_Handle builtin_lib = | 1191 Dart_Handle builtin_lib = |
| 1192 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); | 1192 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
| 1193 ASSERT(!Dart_IsError(builtin_lib)); | 1193 ASSERT(!Dart_IsError(builtin_lib)); |
| 1194 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null()); | 1194 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null()); |
| 1195 | 1195 |
| 1196 if (has_gen_precompiled_snapshot) { | 1196 if (has_noopt || has_gen_precompiled_snapshot) { |
| 1197 // Load the embedder's portion of the VM service's Dart code so it will | 1197 // Load the embedder's portion of the VM service's Dart code so it will |
| 1198 // be included in the precompiled snapshot. | 1198 // be included in the precompiled snapshot. |
| 1199 if (!VmService::LoadForGenPrecompiled()) { | 1199 if (!VmService::LoadForGenPrecompiled()) { |
| 1200 fprintf(stderr, | 1200 fprintf(stderr, |
| 1201 "VM service loading failed: %s\n", | 1201 "VM service loading failed: %s\n", |
| 1202 VmService::GetErrorMessage()); | 1202 VmService::GetErrorMessage()); |
| 1203 fflush(stderr); | 1203 fflush(stderr); |
| 1204 exit(kErrorExitCode); | 1204 exit(kErrorExitCode); |
| 1205 } | 1205 } |
| 1206 } | 1206 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1233 { "dart:io", "OSError", "OSError." }, | 1233 { "dart:io", "OSError", "OSError." }, |
| 1234 { "dart:io", "TlsException", "TlsException." }, | 1234 { "dart:io", "TlsException", "TlsException." }, |
| 1235 { "dart:io", "X509Certificate", "X509Certificate._" }, | 1235 { "dart:io", "X509Certificate", "X509Certificate._" }, |
| 1236 { "dart:io", "_ExternalBuffer", "set:data" }, | 1236 { "dart:io", "_ExternalBuffer", "set:data" }, |
| 1237 { "dart:io", "_Platform", "set:_nativeScript" }, | 1237 { "dart:io", "_Platform", "set:_nativeScript" }, |
| 1238 { "dart:io", "_ProcessStartStatus", "set:_errorCode" }, | 1238 { "dart:io", "_ProcessStartStatus", "set:_errorCode" }, |
| 1239 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" }, | 1239 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" }, |
| 1240 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" }, | 1240 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" }, |
| 1241 { "dart:io", "_SecureFilterImpl", "get:SIZE" }, | 1241 { "dart:io", "_SecureFilterImpl", "get:SIZE" }, |
| 1242 { "dart:vmservice_io", "::", "main" }, | 1242 { "dart:vmservice_io", "::", "main" }, |
| 1243 { "dart:vmservice_io", "::", "boot" }, | |
| 1244 { NULL, NULL, NULL } // Must be terminated with NULL entries. | 1243 { NULL, NULL, NULL } // Must be terminated with NULL entries. |
| 1245 }; | 1244 }; |
| 1246 | 1245 |
| 1247 const bool reset_fields = has_gen_precompiled_snapshot; | 1246 const bool reset_fields = has_gen_precompiled_snapshot; |
| 1248 result = Dart_Precompile(standalone_entry_points, reset_fields); | 1247 result = Dart_Precompile(standalone_entry_points, reset_fields); |
| 1249 CHECK_RESULT(result); | 1248 CHECK_RESULT(result); |
| 1250 } | 1249 } |
| 1251 | 1250 |
| 1252 if (has_gen_precompiled_snapshot) { | 1251 if (has_gen_precompiled_snapshot) { |
| 1253 uint8_t* vm_isolate_buffer = NULL; | 1252 uint8_t* vm_isolate_buffer = NULL; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 Platform::Exit(Process::GlobalExitCode()); | 1536 Platform::Exit(Process::GlobalExitCode()); |
| 1538 } | 1537 } |
| 1539 | 1538 |
| 1540 } // namespace bin | 1539 } // namespace bin |
| 1541 } // namespace dart | 1540 } // namespace dart |
| 1542 | 1541 |
| 1543 int main(int argc, char** argv) { | 1542 int main(int argc, char** argv) { |
| 1544 dart::bin::main(argc, argv); | 1543 dart::bin::main(argc, argv); |
| 1545 UNREACHABLE(); | 1544 UNREACHABLE(); |
| 1546 } | 1545 } |
| OLD | NEW |