From 6f6137935afd4e2be69444009babb3ff976d2bc3 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 21 Mar 2019 15:29:48 -0700 Subject: [PATCH 1/2] Fixed service isolate not being initialized correctly due to bad name The name for the service isolate was being set to the empty string, causing the microtask loop to not be run on the service isolate leading to the service hanging on the first 'await'. See https://dart-review.googlesource.com/c/sdk/+/97107 for revert due to this issue. --- runtime/dart_isolate.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 4340ccdc3918c..ff38c9394b080 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -574,7 +574,7 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback( // isolate like normal but dont hold a reference to it at all. We also start // this isolate since we will never again reference it from the engine. return DartCreateAndStartServiceIsolate(advisory_script_uri, // - advisory_script_entrypoint, // + advisory_script_uri, // package_root, // package_config, // flags, // From e4ff5c5d6f90556671c3163b7904aa0eae276b22 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Fri, 22 Mar 2019 08:43:51 -0700 Subject: [PATCH 2/2] Removed unnecessary params from DartCreateAndStartServiceIsolate --- runtime/dart_isolate.cc | 35 ++++++++++++++--------------------- runtime/dart_isolate.h | 2 -- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index ff38c9394b080..8d53f3b13ea62 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -487,8 +487,6 @@ bool DartIsolate::Shutdown() { } Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, const char* package_root, const char* package_config, Dart_IsolateFlags* flags, @@ -517,19 +515,16 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( std::weak_ptr weak_service_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - vm->GetSharedSnapshot(), // shared snapshot - null_task_runners, // task runners - nullptr, // window - {}, // snapshot delegate - {}, // IO Manager - advisory_script_uri == nullptr ? "" - : advisory_script_uri, // script uri - advisory_script_entrypoint == nullptr - ? "" - : advisory_script_entrypoint, // script entrypoint - flags // flags + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + vm->GetSharedSnapshot(), // shared snapshot + null_task_runners, // task runners + nullptr, // window + {}, // snapshot delegate + {}, // IO Manager + DART_VM_SERVICE_ISOLATE_NAME, // script uri + DART_VM_SERVICE_ISOLATE_NAME, // script entrypoint + flags // flags ); std::shared_ptr service_isolate = weak_service_isolate.lock(); @@ -573,12 +568,10 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback( // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service // isolate like normal but dont hold a reference to it at all. We also start // this isolate since we will never again reference it from the engine. - return DartCreateAndStartServiceIsolate(advisory_script_uri, // - advisory_script_uri, // - package_root, // - package_config, // - flags, // - error // + return DartCreateAndStartServiceIsolate(package_root, // + package_config, // + flags, // + error // ); } diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index bcd90a80d112a..d720deafed142 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -138,8 +138,6 @@ class DartIsolate : public UIDartState { char** error); static Dart_Isolate DartCreateAndStartServiceIsolate( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, const char* package_root, const char* package_config, Dart_IsolateFlags* flags,