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

Unified Diff: runtime/bin/main.cc

Issue 2662213004: Do not try to read vm-service and kernel-service (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | 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 f910f34d001a9baabd96bb6900d7f3c1ceab37c4..5b5809bc9f58b31d49e5d6ef61ad668ec9b47a6a 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -862,33 +862,31 @@ static Dart_Isolate CreateIsolateAndSetupHelper(bool is_main_isolate,
intptr_t kernel_length = -1;
bool is_kernel = false;
- if (use_dart_frontend && !is_kernel_isolate && !is_service_isolate) {
- Dart_KernelCompilationResult result = Dart_CompileToKernel(script_uri);
- *error = result.error; // Copy error message (if any).
- switch (result.status) {
- case Dart_KernelCompilationStatus_Ok:
- is_kernel = true;
- kernel_file = result.kernel;
- kernel_length = result.kernel_size;
- break;
- case Dart_KernelCompilationStatus_Error:
- *exit_code = kCompilationErrorExitCode;
- return NULL;
- case Dart_KernelCompilationStatus_Crash:
- *exit_code = kDartFrontendErrorExitCode;
- return NULL;
- case Dart_KernelCompilationStatus_Unknown:
- *exit_code = kErrorExitCode;
- return NULL;
+ if (!is_kernel_isolate && !is_service_isolate) {
+ if (use_dart_frontend) {
+ Dart_KernelCompilationResult result = Dart_CompileToKernel(script_uri);
+ *error = result.error; // Copy error message (if any).
+ switch (result.status) {
+ case Dart_KernelCompilationStatus_Ok:
+ is_kernel = true;
+ kernel_file = result.kernel;
+ kernel_length = result.kernel_size;
+ break;
+ case Dart_KernelCompilationStatus_Error:
+ *exit_code = kCompilationErrorExitCode;
+ return NULL;
+ case Dart_KernelCompilationStatus_Crash:
+ *exit_code = kDartFrontendErrorExitCode;
+ return NULL;
+ case Dart_KernelCompilationStatus_Unknown:
+ *exit_code = kErrorExitCode;
+ return NULL;
+ }
+ } else if (!isolate_run_app_snapshot) {
+ is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length);
}
}
- // If the script is a Kernel binary, then we will try to bootstrap from the
- // script.
- if (!is_kernel && !isolate_run_app_snapshot) {
- is_kernel = TryReadKernel(script_uri, &kernel_file, &kernel_length);
Kevin Millikin (Google) 2017/02/01 11:45:45 This was not guarded by !is_kernel_isolate && !is_
- }
-
void* kernel_program = NULL;
if (is_kernel) {
kernel_program = Dart_ReadKernelBinary(kernel_file, kernel_length);
@@ -897,6 +895,8 @@ static Dart_Isolate CreateIsolateAndSetupHelper(bool is_main_isolate,
IsolateData* isolate_data =
new IsolateData(script_uri, package_root, packages_config);
+ // If the script is a Kernel binary, then we will try to bootstrap from the
+ // script.
Dart_Isolate isolate =
is_kernel ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_program,
flags, isolate_data, error)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698