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

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

Issue 1418833004: VM: Service isolate under precompilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/vmservice_dartium.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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 Builtin::SetNativeResolver(Builtin::kBuiltinLibrary); 757 Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
758 Builtin::SetNativeResolver(Builtin::kIOLibrary); 758 Builtin::SetNativeResolver(Builtin::kIOLibrary);
759 } 759 }
760 760
761 // Set up the library tag handler for this isolate. 761 // Set up the library tag handler for this isolate.
762 Dart_Handle result = Dart_SetLibraryTagHandler(DartUtils::LibraryTagHandler); 762 Dart_Handle result = Dart_SetLibraryTagHandler(DartUtils::LibraryTagHandler);
763 CHECK_RESULT(result); 763 CHECK_RESULT(result);
764 764
765 if (Dart_IsServiceIsolate(isolate)) { 765 if (Dart_IsServiceIsolate(isolate)) {
766 // If this is the service isolate, load embedder specific bits and return. 766 // If this is the service isolate, load embedder specific bits and return.
767 if (!VmService::Setup(vm_service_server_ip, vm_service_server_port)) { 767 if (!VmService::Setup(vm_service_server_ip,
768 vm_service_server_port,
769 has_run_precompiled_snapshot)) {
768 *error = strdup(VmService::GetErrorMessage()); 770 *error = strdup(VmService::GetErrorMessage());
769 return NULL; 771 return NULL;
770 } 772 }
771 if (has_compile_all) { 773 if (has_compile_all) {
772 result = Dart_CompileAll(); 774 result = Dart_CompileAll();
773 CHECK_RESULT(result); 775 CHECK_RESULT(result);
774 } 776 }
775 Dart_ExitScope(); 777 Dart_ExitScope();
776 Dart_ExitIsolate(); 778 Dart_ExitIsolate();
777 return isolate; 779 return isolate;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 } else { 1220 } else {
1219 // Lookup the library of the root script. 1221 // Lookup the library of the root script.
1220 Dart_Handle root_lib = Dart_RootLibrary(); 1222 Dart_Handle root_lib = Dart_RootLibrary();
1221 // Import the root library into the builtin library so that we can easily 1223 // Import the root library into the builtin library so that we can easily
1222 // lookup the main entry point exported from the root library. 1224 // lookup the main entry point exported from the root library.
1223 Dart_Handle builtin_lib = 1225 Dart_Handle builtin_lib =
1224 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); 1226 Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
1225 ASSERT(!Dart_IsError(builtin_lib)); 1227 ASSERT(!Dart_IsError(builtin_lib));
1226 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null()); 1228 result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null());
1227 1229
1230 if (has_gen_precompiled_snapshot) {
1231 // Load the embedder's portion of the VM service's Dart code so it will
1232 // be included in the precompiled snapshot.
1233 if (!VmService::LoadForGenPrecompiled()) {
1234 fprintf(stderr,
1235 "VM service loading failed: %s\n",
1236 VmService::GetErrorMessage());
1237 fflush(stderr);
1238 exit(kErrorExitCode);
1239 }
1240 }
1241
1228 if (has_noopt || has_gen_precompiled_snapshot) { 1242 if (has_noopt || has_gen_precompiled_snapshot) {
1229 Dart_QualifiedFunctionName standalone_entry_points[] = { 1243 Dart_QualifiedFunctionName standalone_entry_points[] = {
1230 { "dart:_builtin", "::", "_getMainClosure" }, 1244 { "dart:_builtin", "::", "_getMainClosure" },
1231 { "dart:_builtin", "::", "_getPrintClosure" }, 1245 { "dart:_builtin", "::", "_getPrintClosure" },
1232 { "dart:_builtin", "::", "_getUriBaseClosure" }, 1246 { "dart:_builtin", "::", "_getUriBaseClosure" },
1233 { "dart:_builtin", "::", "_resolveUri" }, 1247 { "dart:_builtin", "::", "_resolveUri" },
1234 { "dart:_builtin", "::", "_setWorkingDirectory" }, 1248 { "dart:_builtin", "::", "_setWorkingDirectory" },
1235 { "dart:_builtin", "::", "_loadDataAsync" }, 1249 { "dart:_builtin", "::", "_loadDataAsync" },
1236 { "dart:io", "::", "_makeUint8ListView" }, 1250 { "dart:io", "::", "_makeUint8ListView" },
1237 { "dart:io", "::", "_makeDatagram" }, 1251 { "dart:io", "::", "_makeDatagram" },
1238 { "dart:io", "::", "_setupHooks" }, 1252 { "dart:io", "::", "_setupHooks" },
1253 { "dart:io", "::", "_getWatchSignalInternal" },
1239 { "dart:io", "CertificateException", "CertificateException." }, 1254 { "dart:io", "CertificateException", "CertificateException." },
1240 { "dart:io", "HandshakeException", "HandshakeException." }, 1255 { "dart:io", "HandshakeException", "HandshakeException." },
1241 { "dart:io", "OSError", "OSError." }, 1256 { "dart:io", "OSError", "OSError." },
1242 { "dart:io", "TlsException", "TlsException." }, 1257 { "dart:io", "TlsException", "TlsException." },
1243 { "dart:io", "X509Certificate", "X509Certificate._" }, 1258 { "dart:io", "X509Certificate", "X509Certificate._" },
1244 { "dart:io", "_ExternalBuffer", "set:data" }, 1259 { "dart:io", "_ExternalBuffer", "set:data" },
1245 { "dart:io", "_Platform", "set:_nativeScript" }, 1260 { "dart:io", "_Platform", "set:_nativeScript" },
1246 { "dart:io", "_ProcessStartStatus", "set:_errorCode" }, 1261 { "dart:io", "_ProcessStartStatus", "set:_errorCode" },
1247 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" }, 1262 { "dart:io", "_ProcessStartStatus", "set:_errorMessage" },
1248 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" }, 1263 { "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" },
1249 { "dart:io", "_SecureFilterImpl", "get:SIZE" }, 1264 { "dart:io", "_SecureFilterImpl", "get:SIZE" },
1250 { "dart:vmservice_io", "::", "_addResource" }, 1265 { "dart:vmservice_io", "::", "_addResource" },
1251 { "dart:vmservice_io", "::", "main" }, 1266 { "dart:vmservice_io", "::", "main" },
1267 { "dart:vmservice_io", "::", "boot" },
1252 { NULL, NULL, NULL } // Must be terminated with NULL entries. 1268 { NULL, NULL, NULL } // Must be terminated with NULL entries.
1253 }; 1269 };
1254 1270
1255 const bool reset_fields = has_gen_precompiled_snapshot; 1271 const bool reset_fields = has_gen_precompiled_snapshot;
1256 result = Dart_Precompile(standalone_entry_points, reset_fields); 1272 result = Dart_Precompile(standalone_entry_points, reset_fields);
1257 CHECK_RESULT(result); 1273 CHECK_RESULT(result);
1258 } 1274 }
1259 1275
1260 if (has_gen_precompiled_snapshot) { 1276 if (has_gen_precompiled_snapshot) {
1261 uint8_t* vm_isolate_buffer = NULL; 1277 uint8_t* vm_isolate_buffer = NULL;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 exit(Process::GlobalExitCode()); 1516 exit(Process::GlobalExitCode());
1501 } 1517 }
1502 1518
1503 } // namespace bin 1519 } // namespace bin
1504 } // namespace dart 1520 } // namespace dart
1505 1521
1506 int main(int argc, char** argv) { 1522 int main(int argc, char** argv) {
1507 dart::bin::main(argc, argv); 1523 dart::bin::main(argc, argv);
1508 UNREACHABLE(); 1524 UNREACHABLE();
1509 } 1525 }
OLDNEW
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/vmservice_dartium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698