From e1c750d6a3f13ca6fd04b3c2b1d7c6538d819491 Mon Sep 17 00:00:00 2001 From: asiva Date: Tue, 9 Jul 2019 15:23:57 -0700 Subject: [PATCH 1/2] Roll src/third_party/dart 06c3d7ad3a...09fc76bc51 dart-lang/sdk@09fc76bc51 [vm, compiler] Remove dead _classRangeCheckNegative. dart-lang/sdk@b472d7a9be Unnecessary null aware spread hint dart-lang/sdk@f939ad3964 library scope extensions dart-lang/sdk@9503969664 [vm/bytecode] Add DebugCheck bytecode instruction dart-lang/sdk@fc542be6b4 Issue 36682. Check that selection offset/length is valid in Extract Method refactoring. dart-lang/sdk@803658a6d8 [corelib_2] fix bigint_from_test for web platforms dart-lang/sdk@ad6b1ebbd6 Support for 'double' fields in protocol. dart-lang/sdk@5479175012 Remove incorrect test. dart-lang/sdk@058092b5f6 [vm] Fix simarm_x64 build on mac dart-lang/sdk@307ca3f3b6 [vm/bytecode] Improve single stepping and breakpoint setting in bytecode. dart-lang/sdk@855830f324 Update LSP spec dart-lang/sdk@d992f55094 [dartfix] Bump pedantic dep to v1.8.0 and cleanup lint violations dart-lang/sdk@41330f3e34 gitignore .clangd dart-lang/sdk@8d07009931 [ VM / Gardening ] Mark disassemble_determinism_test as slow on Windows dart-lang/sdk@1b82367ed6 Update CHANGELOG to reflect breaking change #36765 dart-lang/sdk@a86db84e0a [fasta] Preserve information about const constructors in outline. dart-lang/sdk@25319ef7a6 Fix bug in codegen/string_escapes_test.dart. dart-lang/sdk@7acecda2cc [vm/ffi] Fix FFI Utf8 example. dart-lang/sdk@e3b3c6fa28 [vm] Rename 3head flutter patch after re-land of concurrency change dart-lang/sdk@2cb5303782 [infra] Update checked in SDKs to 2.4.0 dart-lang/sdk@fce43ebc4e [ddk] Pass environmentDefines to CFE through CompilerOptions dart-lang/sdk@5450d08ca1 Add support for analyzer static error tests. dart-lang/sdk@0425997b31 Second attempt to reland "[vm/concurrency] Introduce concept of Isolate Groups" dart-lang/sdk@5470159054 [vm, gc] Produce a proper error message when crashing due to lack of memory at isolate startup. dart-lang/sdk@bfc7d21da6 Remove useless dart2js_extra/class_test dart-lang/sdk@572619b639 [vm, bytecode] Fix vm/cc/CompileFunctionOnHelperThread. dart-lang/sdk@4de495fccc [vm, compiler] Remove dead stub ICCallThroughFunction. dart-lang/sdk@8a1dcdae68 Graduate 'flutter' domain from experimental, remove unused methods and fields. dart-lang/sdk@a945888627 Discard constructors and fields temporarily to get valid code compiling --- DEPS | 6 ++--- ci/licenses_golden/licenses_third_party | 2 +- runtime/dart_isolate.cc | 18 +++++++------ runtime/dart_isolate.h | 10 +++---- runtime/dart_vm.cc | 13 +++++----- .../fuchsia/dart/dart_component_controller.cc | 7 ++--- shell/platform/fuchsia/dart/dart_runner.cc | 26 +++++++++---------- .../platform/fuchsia/dart/service_isolate.cc | 8 +++--- 8 files changed, 47 insertions(+), 43 deletions(-) diff --git a/DEPS b/DEPS index 2765ff2f80279..e258fb73efe73 100644 --- a/DEPS +++ b/DEPS @@ -34,7 +34,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '06c3d7ad3a33b7c4d42067c1a24c9279c321071f', + 'dart_revision': '09fc76bc51274e91b76d8a9030a236a678311392', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py @@ -364,7 +364,7 @@ deps = { Var('dart_git') + '/package_resolver.git' + '@' + Var('dart_package_resolver_tag'), 'src/third_party/dart/tools/sdks': - {'packages': [{'version': 'version:2.3.3-dev.0.0', 'package': 'dart/dart-sdk/${{platform}}'}], 'dep_type': 'cipd'}, + {'packages': [{'version': 'version:2.4.0', 'package': 'dart/dart-sdk/${{platform}}'}], 'dep_type': 'cipd'}, # WARNING: end of dart dependencies list that is cleaned up automatically - see create_updated_flutter_deps.py. @@ -467,7 +467,7 @@ deps = { 'packages': [ { 'package': 'dart/dart-sdk/${{platform}}', - 'version': 'version:2.3.0' + 'version': 'version:2.4.0' } ], 'dep_type': 'cipd', diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index fa63f985175c1..7257685161a5c 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f5fe7081d04877d56a90cf48e34de6c6 +Signature: 867dd399b0f19bf93a3ed95b59498779 UNUSED LICENSES: diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 96ac6facd333a..5686a6f14e50a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -163,7 +163,7 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { } auto* isolate_data = static_cast*>( - Dart_IsolateData(dart_isolate)); + Dart_IsolateGroupData(dart_isolate)); if (isolate_data->get() != this) { return false; } @@ -174,7 +174,7 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { // We are entering a new scope (for the first time since initialization) and // we want to restore the current scope to null when we exit out of this // method. This balances the implicit Dart_EnterIsolate call made by - // Dart_CreateIsolate (which calls the Initialize). + // Dart_CreateIsolateGroup (which calls the Initialize). Dart_ExitIsolate(); tonic::DartIsolateScope scope(isolate()); @@ -636,8 +636,8 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( return service_isolate->isolate(); } -// |Dart_IsolateCreateCallback| -Dart_Isolate DartIsolate::DartIsolateCreateCallback( +// |Dart_IsolateGroupCreateCallback| +Dart_Isolate DartIsolate::DartIsolateGroupCreateCallback( const char* advisory_script_uri, const char* advisory_script_entrypoint, const char* package_root, @@ -720,14 +720,16 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( } // Create the Dart VM isolate and give it the embedder object as the baton. - Dart_Isolate isolate = Dart_CreateIsolate( + Dart_Isolate isolate = Dart_CreateIsolateGroup( advisory_script_uri, // advisory_script_entrypoint, // (*embedder_isolate)->GetIsolateSnapshot()->GetDataMapping(), (*embedder_isolate)->GetIsolateSnapshot()->GetInstructionsMapping(), (*embedder_isolate)->GetSharedSnapshot()->GetDataMapping(), (*embedder_isolate)->GetSharedSnapshot()->GetInstructionsMapping(), flags, - embedder_isolate.get(), error); + embedder_isolate.get(), // isolate_group_data + embedder_isolate.get(), // isolate_group + error); if (isolate == nullptr) { FML_DLOG(ERROR) << *error; @@ -775,8 +777,8 @@ void DartIsolate::DartIsolateShutdownCallback( isolate_group_data->get()->OnShutdownCallback(); } -// |Dart_IsolateCleanupCallback| -void DartIsolate::DartIsolateCleanupCallback( +// |Dart_IsolateGroupCleanupCallback| +void DartIsolate::DartIsolateGroupCleanupCallback( std::shared_ptr* isolate_data) { delete isolate_data; } diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 60412972abc93..453810b1bdab3 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -156,8 +156,8 @@ class DartIsolate : public UIDartState { void OnShutdownCallback(); - // |Dart_IsolateCreateCallback| - static Dart_Isolate DartIsolateCreateCallback( + // |Dart_IsolateGroupCreateCallback| + static Dart_Isolate DartIsolateGroupCreateCallback( const char* advisory_script_uri, const char* advisory_script_entrypoint, const char* package_root, @@ -189,9 +189,9 @@ class DartIsolate : public UIDartState { std::shared_ptr* isolate_group_data, std::shared_ptr* isolate_data); - // |Dart_IsolateCleanupCallback| - static void DartIsolateCleanupCallback( - std::shared_ptr* embedder_isolate); + // |Dart_IsolateGroupCleanupCallback| + static void DartIsolateGroupCleanupCallback( + std::shared_ptr* isolate_group_data); FML_DISALLOW_COPY_AND_ASSIGN(DartIsolate); }; diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 903e74b1591f7..555d0c9ee17e2 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -366,12 +366,13 @@ DartVM::DartVM(std::shared_ptr vm_data, params.vm_snapshot_data = vm_data_->GetVMSnapshot().GetDataMapping(); params.vm_snapshot_instructions = vm_data_->GetVMSnapshot().GetInstructionsMapping(); - params.create = reinterpret_cast( - DartIsolate::DartIsolateCreateCallback); - params.shutdown = reinterpret_cast( - DartIsolate::DartIsolateShutdownCallback); - params.cleanup = reinterpret_cast( - DartIsolate::DartIsolateCleanupCallback); + params.create_group = reinterpret_cast( + DartIsolate::DartIsolateGroupCreateCallback); + params.shutdown_isolate = + reinterpret_cast( + DartIsolate::DartIsolateShutdownCallback); + params.cleanup_group = reinterpret_cast( + DartIsolate::DartIsolateGroupCleanupCallback); params.thread_exit = ThreadExitCallback; params.get_service_assets = GetVMServiceAssetsArchiveCallback; params.entropy_source = dart::bin::GetEntropy; diff --git a/shell/platform/fuchsia/dart/dart_component_controller.cc b/shell/platform/fuchsia/dart/dart_component_controller.cc index 1c4f71050594d..c8e7cc5ab7950 100644 --- a/shell/platform/fuchsia/dart/dart_component_controller.cc +++ b/shell/platform/fuchsia/dart/dart_component_controller.cc @@ -324,12 +324,13 @@ bool DartComponentController::CreateIsolate( auto state = new std::shared_ptr(new tonic::DartState( namespace_fd, [this](Dart_Handle result) { MessageEpilogue(result); })); - isolate_ = Dart_CreateIsolate( + isolate_ = Dart_CreateIsolateGroup( url_.c_str(), label_.c_str(), isolate_snapshot_data, isolate_snapshot_instructions, shared_snapshot_data, - shared_snapshot_instructions, nullptr /* flags */, state, &error); + shared_snapshot_instructions, nullptr /* flags */, + state /* isolate_group_data */, state /* isolate_data */, &error); if (!isolate_) { - FX_LOGF(ERROR, LOG_TAG, "Dart_CreateIsolate failed: %s", error); + FX_LOGF(ERROR, LOG_TAG, "Dart_CreateIsolateGroup failed: %s", error); return false; } diff --git a/shell/platform/fuchsia/dart/dart_runner.cc b/shell/platform/fuchsia/dart/dart_runner.cc index 200500d2c90f6..18ec084ad15e0 100644 --- a/shell/platform/fuchsia/dart/dart_runner.cc +++ b/shell/platform/fuchsia/dart/dart_runner.cc @@ -61,13 +61,13 @@ const char* kDartVMArgs[] = { // clang-format on }; -Dart_Isolate IsolateCreateCallback(const char* uri, - const char* name, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - void* callback_data, - char** error) { +Dart_Isolate IsolateGroupCreateCallback(const char* uri, + const char* name, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + void* callback_data, + char** error) { if (std::string(uri) == DART_VM_SERVICE_ISOLATE_NAME) { #if defined(DART_PRODUCT) *error = strdup("The service isolate is not implemented in product mode"); @@ -81,7 +81,7 @@ Dart_Isolate IsolateCreateCallback(const char* uri, return NULL; } -void IsolateShutdownCallback(void* callback_data) { +void IsolateShutdownCallback(void* isolate_group_data, void* isolate_data) { // The service isolate (and maybe later the kernel isolate) doesn't have an // async loop. auto dispatcher = async_get_default_dispatcher(); @@ -92,8 +92,8 @@ void IsolateShutdownCallback(void* callback_data) { } } -void IsolateCleanupCallback(void* callback_data) { - delete static_cast*>(callback_data); +void IsolateCleanupCallback(void* isolate_group_data) { + delete static_cast*>(isolate_group_data); } void RunApplication( @@ -167,9 +167,9 @@ DartRunner::DartRunner() : context_(sys::ComponentContext::Create()) { params.vm_snapshot_data = vm_snapshot_data_.address(); params.vm_snapshot_instructions = vm_snapshot_instructions_.address(); #endif - params.create = IsolateCreateCallback; - params.shutdown = IsolateShutdownCallback; - params.cleanup = IsolateCleanupCallback; + params.create_group = IsolateGroupCreateCallback; + params.shutdown_isolate = IsolateShutdownCallback; + params.cleanup_group = IsolateGroupCleanupCallback; params.entropy_source = EntropySource; #if !defined(DART_PRODUCT) params.get_service_assets = GetVMServiceAssetsArchiveCallback; diff --git a/shell/platform/fuchsia/dart/service_isolate.cc b/shell/platform/fuchsia/dart/service_isolate.cc index 2e6eda2659de4..5287d638f29ab 100644 --- a/shell/platform/fuchsia/dart/service_isolate.cc +++ b/shell/platform/fuchsia/dart/service_isolate.cc @@ -123,14 +123,14 @@ Dart_Isolate CreateServiceIsolate(const char* uri, #endif auto state = new std::shared_ptr(new tonic::DartState()); - Dart_Isolate isolate = Dart_CreateIsolate( + Dart_Isolate isolate = Dart_CreateIsolateGroup( uri, DART_VM_SERVICE_ISOLATE_NAME, mapped_isolate_snapshot_data.address(), mapped_isolate_snapshot_instructions.address(), mapped_shared_snapshot_data.address(), - mapped_shared_snapshot_instructions.address(), nullptr /* flags */, state, - error); + mapped_shared_snapshot_instructions.address(), nullptr /* flags */, + state /* isolate_group_data */, state /* isolate_data */, error); if (!isolate) { - FX_LOGF(ERROR, LOG_TAG, "Dart_CreateIsolate failed: %s", *error); + FX_LOGF(ERROR, LOG_TAG, "Dart_CreateIsolateGroup failed: %s", *error); return nullptr; } From 02f143689d559e682d22bb241e902c9458fab51e Mon Sep 17 00:00:00 2001 From: asiva Date: Tue, 9 Jul 2019 16:08:42 -0700 Subject: [PATCH 2/2] Fix analyzer warning. --- lib/ui/hooks.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/hooks.dart b/lib/ui/hooks.dart index 9378857e9628a..305dde4721c28 100644 --- a/lib/ui/hooks.dart +++ b/lib/ui/hooks.dart @@ -205,7 +205,7 @@ void _runMainZoned(Function startMainIsolateFunction, Function userMainFunction, List args) { startMainIsolateFunction((){ - runZoned>(() { + runZoned(() { if (userMainFunction is _BinaryFunction) { // This seems to be undocumented but supported by the command line VM. // Let's do the same in case old entry-points are ported to Flutter.