Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: runtime/bin/main.cc

Issue 1359963002: Let the embedder provide entry points to Dart_Precompile. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // Lookup the library of the root script. 1252 // Lookup the library of the root script.
1253 Dart_Handle root_lib = Dart_RootLibrary(); 1253 Dart_Handle root_lib = Dart_RootLibrary();
1254 // Import the root library into the builtin library so that we can easily 1254 // Import the root library into the builtin library so that we can easily
1255 // lookup the main entry point exported from the root library. 1255 // lookup the main entry point exported from the root library.
1256 Dart_Handle builtin_lib = 1256 Dart_Handle builtin_lib =
1257 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); 1257 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
1258 ASSERT(!Dart_IsError(builtin_lib)); 1258 ASSERT(!Dart_IsError(builtin_lib));
1259 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null()); 1259 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null());
1260 1260
1261 if (has_gen_precompiled_snapshot) { 1261 if (has_gen_precompiled_snapshot) {
1262 result = Dart_Precompile(); 1262 Dart_QualifiedFunctionName standalone_entry_points[] = {
1263 { "dart:_builtin", "::", "_getMainClosure" },
1264 { "dart:_builtin", "::", "_getPrintClosure" },
1265 { "dart:_builtin", "::", "_getUriBaseClosure" },
1266 { "dart:_builtin", "::", "_resolveUri" },
1267 { "dart:_builtin", "::", "_setWorkingDirectory" },
1268 { "dart:_builtin", "::", "_loadDataAsync" },
1269 { "dart:io", "::", "_makeUint8ListView" },
1270 { "dart:io", "::", "_makeDatagram" },
1271 { "dart:io", "::", "_setupHooks" },
1272 { "dart:io", "CertificateException", "CertificateException." },
1273 { "dart:io", "HandshakeException", "HandshakeException." },
1274 { "dart:io", "TlsException", "TlsException." },
1275 { "dart:io", "X509Certificate", "X509Certificate." },
1276 { "dart:io", "_ExternalBuffer", "set:data" },
1277 { "dart:io", "_Platform", "set:_nativeScript" },
1278 { "dart:io", "_ProcessStartStatus", "set:_errorCode" },
1279 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" },
1280 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" },
1281 { "dart:io", "_SecureFilterImpl", "get:SIZE" },
1282 { "dart:vmservice_io", "::", "_addResource" },
1283 { "dart:vmservice_io", "::", "main" },
1284 { NULL, NULL, NULL } // Must be terminated with NULL entries.
1285 };
1286
1287 result = Dart_Precompile(standalone_entry_points);
1263 DartExitOnError(result); 1288 DartExitOnError(result);
1264 1289
1265 uint8_t* vm_isolate_buffer = NULL; 1290 uint8_t* vm_isolate_buffer = NULL;
1266 intptr_t vm_isolate_size = 0; 1291 intptr_t vm_isolate_size = 0;
1267 uint8_t* isolate_buffer = NULL; 1292 uint8_t* isolate_buffer = NULL;
1268 intptr_t isolate_size = 0; 1293 intptr_t isolate_size = 0;
1269 uint8_t* instructions_buffer = NULL; 1294 uint8_t* instructions_buffer = NULL;
1270 intptr_t instructions_size = 0; 1295 intptr_t instructions_size = 0;
1271 result = Dart_CreatePrecompiledSnapshot(&vm_isolate_buffer, 1296 result = Dart_CreatePrecompiledSnapshot(&vm_isolate_buffer,
1272 &vm_isolate_size, 1297 &vm_isolate_size,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 exit(Process::GlobalExitCode()); 1395 exit(Process::GlobalExitCode());
1371 } 1396 }
1372 1397
1373 } // namespace bin 1398 } // namespace bin
1374 } // namespace dart 1399 } // namespace dart
1375 1400
1376 int main(int argc, char** argv) { 1401 int main(int argc, char** argv) {
1377 dart::bin::main(argc, argv); 1402 dart::bin::main(argc, argv);
1378 UNREACHABLE(); 1403 UNREACHABLE();
1379 } 1404 }
OLDNEW
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698