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

Unified Diff: runtime/bin/main.cc

Issue 1834743003: Precompilation: don't start the service isolate in product mode. Remove vm service tree shaking roo… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 0eafb9cbbee15d703dec159558f4bb3011521235..719661e496124fc7333d8b1d507fdcee15495a5e 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -743,31 +743,31 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
char** error,
int* exit_code) {
ASSERT(script_uri != NULL);
-#if defined(DART_PRODUCT_BINARY)
- if (strcmp(script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) {
- // No service isolate support.
- return NULL;
- }
-#endif // defined(DART_PRODUCT_BINARY)
- if (run_full_snapshot &&
+#if defined(DART_PRODUCT_BINARY)
+ const bool run_service_isolate = false;
+#elif defined(PRODUCT)
+ const bool run_service_isolate = !run_full_snapshot &&
+ !run_precompiled_snapshot;
+#else
+ const bool run_service_isolate = !run_full_snapshot;
+#endif
+ if (!run_service_isolate &&
(strcmp(script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0)) {
// We do not create a service isolate when running a full application
- // snapshot.
+ // snapshot or a precompiled snapshot in product mode.
return NULL;
}
+
IsolateData* isolate_data = new IsolateData(script_uri,
package_root,
packages_config);
- Dart_Isolate isolate = NULL;
-
- isolate = Dart_CreateIsolate(script_uri,
- main,
- isolate_snapshot_buffer,
- flags,
- isolate_data,
- error);
-
+ Dart_Isolate isolate = Dart_CreateIsolate(script_uri,
+ main,
+ isolate_snapshot_buffer,
+ flags,
+ isolate_data,
+ error);
if (isolate == NULL) {
delete isolate_data;
return NULL;
@@ -812,7 +812,7 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
result = DartUtils::PrepareForScriptLoading(false, trace_loading);
CHECK_RESULT(result);
- if (!run_full_snapshot) {
+ if (run_service_isolate) {
// Set up the load port provided by the service isolate so that we can
// load scripts.
result = DartUtils::SetupServiceLoadPort();
@@ -1299,7 +1299,7 @@ bool RunMainIsolate(const char* script_name,
reinterpret_cast<IsolateData*>(Dart_IsolateData(isolate));
result = Dart_LibraryImportLibrary(
isolate_data->builtin_lib(), root_lib, Dart_Null());
-#ifndef DART_PRODUCT_BINARY
+#if !defined(DART_PRODUCT_BINARY) && !defined(PRODUCT)
if (is_noopt || gen_precompiled_snapshot) {
// Load the embedder's portion of the VM service's Dart code so it will
// be included in the precompiled snapshot.
@@ -1347,7 +1347,9 @@ bool RunMainIsolate(const char* script_name,
{ "dart:io", "_ProcessStartStatus", "set:_errorMessage" },
{ "dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE" },
{ "dart:io", "_SecureFilterImpl", "get:SIZE" },
+#if !defined(PRODUCT)
{ "dart:vmservice_io", "::", "main" },
+#endif // !PRODUCT
{ NULL, NULL, NULL } // Must be terminated with NULL entries.
};
« 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