From 99ae1b775fe2078b23c79c4104d9d89ae944f854 Mon Sep 17 00:00:00 2001 From: ColdPaleLight <31977171+ColdPaleLight@users.noreply.github.com> Date: Sat, 8 Jan 2022 02:05:10 +0800 Subject: [PATCH] Remove AOT specific gates for isolate groups (flutter/engine#30743) --- engine/src/flutter/runtime/dart_isolate.cc | 4 +- engine/src/flutter/runtime/dart_vm.cc | 5 +- .../flutter/shell/common/shell_unittests.cc | 48 ++++++++----------- 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/engine/src/flutter/runtime/dart_isolate.cc b/engine/src/flutter/runtime/dart_isolate.cc index 7a02186f37..494e3df385 100644 --- a/engine/src/flutter/runtime/dart_isolate.cc +++ b/engine/src/flutter/runtime/dart_isolate.cc @@ -219,9 +219,7 @@ std::weak_ptr DartIsolate::CreateRootIsolate( auto isolate_flags = flags.Get(); IsolateMaker isolate_maker; - // TODO(74520): Remove IsRunningPrecompiledCode conditional once isolate - // groups are supported by JIT. - if (spawning_isolate && DartVM::IsRunningPrecompiledCode()) { + if (spawning_isolate) { isolate_maker = [spawning_isolate]( std::shared_ptr* isolate_group_data, diff --git a/engine/src/flutter/runtime/dart_vm.cc b/engine/src/flutter/runtime/dart_vm.cc index 17591c9d05..1334a15029 100644 --- a/engine/src/flutter/runtime/dart_vm.cc +++ b/engine/src/flutter/runtime/dart_vm.cc @@ -57,10 +57,7 @@ static const char* kDartLanguageArgs[] = { // clang-format on }; -// TODO(74520): Remove flag once isolate group work is completed (or add it to -// JIT mode). -static const char* kDartPrecompilationArgs[] = {"--precompilation", - "--enable-isolate-groups"}; +static const char* kDartPrecompilationArgs[] = {"--precompilation"}; FML_ALLOW_UNUSED_TYPE static const char* kDartWriteProtectCodeArgs[] = { diff --git a/engine/src/flutter/shell/common/shell_unittests.cc b/engine/src/flutter/shell/common/shell_unittests.cc index eb57ea7eaa..46cd8863d0 100644 --- a/engine/src/flutter/shell/common/shell_unittests.cc +++ b/engine/src/flutter/shell/common/shell_unittests.cc @@ -2821,20 +2821,16 @@ TEST_F(ShellTest, Spawn) { spawn->GetEngine()->GetLastEntrypoint()); ASSERT_EQ(initial_route, spawn->GetEngine()->InitialRoute()); - // TODO(74520): Remove conditional once isolate groups are - // supported by JIT. - if (DartVM::IsRunningPrecompiledCode()) { - ASSERT_NE(spawner->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup(), - 0u); - ASSERT_EQ(spawner->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup(), - spawn->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup()); - } + ASSERT_NE(spawner->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup(), + 0u); + ASSERT_EQ(spawner->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup(), + spawn->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup()); }); PostSync( @@ -2928,20 +2924,16 @@ TEST_F(ShellTest, SpawnWithDartEntrypointArgs) { spawn->GetEngine()->GetLastEntrypoint()); ASSERT_EQ(initial_route, spawn->GetEngine()->InitialRoute()); - // TODO(74520): Remove conditional once isolate groups are - // supported by JIT. - if (DartVM::IsRunningPrecompiledCode()) { - ASSERT_NE(spawner->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup(), - 0u); - ASSERT_EQ(spawner->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup(), - spawn->GetEngine() - ->GetRuntimeController() - ->GetRootIsolateGroup()); - } + ASSERT_NE(spawner->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup(), + 0u); + ASSERT_EQ(spawner->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup(), + spawn->GetEngine() + ->GetRuntimeController() + ->GetRootIsolateGroup()); }); PostSync(