Chromium Code Reviews| Index: runtime/bin/main.cc |
| diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc |
| index 6be11f0cc2cb8bf01044760242a257486fd10e48..cf14337d22456bda232e322ff989a761a6423b56 100644 |
| --- a/runtime/bin/main.cc |
| +++ b/runtime/bin/main.cc |
| @@ -407,12 +407,14 @@ static bool ProcessFullSnapshotAfterRunOption( |
| static bool ProcessRunFullSnapshotOption( |
| const char* filename, CommandLineOptions* vm_options) { |
| +#ifndef DART_PRODUCT_BINARY |
| // Ensure that we are not running 'dart_no_snapshot'. |
| if (isolate_snapshot_buffer == NULL) { |
| Log::PrintErr("Full Application snapshots cannot be run with" |
| " dart_no_snapshot\n"); |
| return false; |
| } |
| +#endif |
| return ProcessSnapshotOptionHelper(filename, &run_full_snapshot); |
| } |
| @@ -742,8 +744,15 @@ 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 && |
| - !strcmp(script_uri, DART_VM_SERVICE_ISOLATE_NAME)) { |
| + (strcmp(script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0)) { |
|
siva
2016/02/12 18:18:02
I am wondering if we can move all this run_full_sn
Cutch
2016/02/12 18:33:43
I've made it so this flag only works in the dart_p
|
| // We do not create a service isolate when running a full application |
| // snapshot. |
| return NULL; |
| @@ -777,6 +786,9 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri, |
| Dart_Handle result = Dart_SetLibraryTagHandler(DartUtils::LibraryTagHandler); |
| CHECK_RESULT(result); |
| +#if defined(DART_PRODUCT_BINARY) |
| + ASSERT(!Dart_IsServiceIsolate(isolate)); |
| +#else |
| if (Dart_IsServiceIsolate(isolate)) { |
| // If this is the service isolate, load embedder specific bits and return. |
| if (!VmService::Setup(vm_service_server_ip, |
| @@ -793,6 +805,7 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri, |
| Dart_ExitIsolate(); |
| return isolate; |
| } |
| +#endif // defined(DART_PRODUCT_BINARY) |
| // Prepare builtin and other core libraries for use to resolve URIs. |
| // Set up various closures, e.g: printing, timers etc. |
| @@ -1268,6 +1281,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 (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. |
| @@ -1279,6 +1293,7 @@ bool RunMainIsolate(const char* script_name, |
| exit(kErrorExitCode); |
| } |
| } |
| +#endif // !DART_PRODUCT_BINARY |
| if (compile_all) { |
| result = Dart_CompileAll(); |