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

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

Issue 1663893002: Precompilation: Make missing entry points an error. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: whitespace Created 4 years, 10 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/vm/precompiler.cc » ('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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 GenerateScriptSnapshot(); 1170 GenerateScriptSnapshot();
1171 } else { 1171 } else {
1172 // Lookup the library of the root script. 1172 // Lookup the library of the root script.
1173 Dart_Handle root_lib = Dart_RootLibrary(); 1173 Dart_Handle root_lib = Dart_RootLibrary();
1174 // Import the root library into the builtin library so that we can easily 1174 // Import the root library into the builtin library so that we can easily
1175 // lookup the main entry point exported from the root library. 1175 // lookup the main entry point exported from the root library.
1176 IsolateData* isolate_data = 1176 IsolateData* isolate_data =
1177 reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate)); 1177 reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate));
1178 result = Dart_LibraryImportLibrary( 1178 result = Dart_LibraryImportLibrary(
1179 isolate_data->builtin_lib(), root_lib, Dart_Null()); 1179 isolate_data->builtin_lib(), root_lib, Dart_Null());
1180 if (has_gen_precompiled_snapshot) { 1180 if (has_noopt || has_gen_precompiled_snapshot) {
1181 // Load the embedder's portion of the VM service's Dart code so it will 1181 // Load the embedder's portion of the VM service's Dart code so it will
1182 // be included in the precompiled snapshot. 1182 // be included in the precompiled snapshot.
1183 if (!VmService::LoadForGenPrecompiled()) { 1183 if (!VmService::LoadForGenPrecompiled()) {
1184 fprintf(stderr, 1184 fprintf(stderr,
1185 "VM service loading failed: %s\n", 1185 "VM service loading failed: %s\n",
1186 VmService::GetErrorMessage()); 1186 VmService::GetErrorMessage());
1187 fflush(stderr); 1187 fflush(stderr);
1188 exit(kErrorExitCode); 1188 exit(kErrorExitCode);
1189 } 1189 }
1190 } 1190 }
(...skipping 26 matching lines...) Expand all
1217 { "dart:io", "OSError", "OSError." }, 1217 { "dart:io", "OSError", "OSError." },
1218 { "dart:io", "TlsException", "TlsException." }, 1218 { "dart:io", "TlsException", "TlsException." },
1219 { "dart:io", "X509Certificate", "X509Certificate._" }, 1219 { "dart:io", "X509Certificate", "X509Certificate._" },
1220 { "dart:io", "_ExternalBuffer", "set:data" }, 1220 { "dart:io", "_ExternalBuffer", "set:data" },
1221 { "dart:io", "_Platform", "set:_nativeScript" }, 1221 { "dart:io", "_Platform", "set:_nativeScript" },
1222 { "dart:io", "_ProcessStartStatus", "set:_errorCode" }, 1222 { "dart:io", "_ProcessStartStatus", "set:_errorCode" },
1223 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" }, 1223 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" },
1224 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" }, 1224 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" },
1225 { "dart:io", "_SecureFilterImpl", "get:SIZE" }, 1225 { "dart:io", "_SecureFilterImpl", "get:SIZE" },
1226 { "dart:vmservice_io", "::", "main" }, 1226 { "dart:vmservice_io", "::", "main" },
1227 { "dart:vmservice_io", "::", "boot" },
1228 { NULL, NULL, NULL } // Must be terminated with NULL entries. 1227 { NULL, NULL, NULL } // Must be terminated with NULL entries.
1229 }; 1228 };
1230 1229
1231 const bool reset_fields = has_gen_precompiled_snapshot; 1230 const bool reset_fields = has_gen_precompiled_snapshot;
1232 result = Dart_Precompile(standalone_entry_points, reset_fields); 1231 result = Dart_Precompile(standalone_entry_points, reset_fields);
1233 CHECK_RESULT(result); 1232 CHECK_RESULT(result);
1234 } 1233 }
1235 1234
1236 if (has_gen_precompiled_snapshot) { 1235 if (has_gen_precompiled_snapshot) {
1237 uint8_t* vm_isolate_buffer = NULL; 1236 uint8_t* vm_isolate_buffer = NULL;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 Platform::Exit(Process::GlobalExitCode()); 1530 Platform::Exit(Process::GlobalExitCode());
1532 } 1531 }
1533 1532
1534 } // namespace bin 1533 } // namespace bin
1535 } // namespace dart 1534 } // namespace dart
1536 1535
1537 int main(int argc, char** argv) { 1536 int main(int argc, char** argv) {
1538 dart::bin::main(argc, argv); 1537 dart::bin::main(argc, argv);
1539 UNREACHABLE(); 1538 UNREACHABLE();
1540 } 1539 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698