From 454e2dfdd8dc7edd57c4e13555db6990e095a323 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 12 Feb 2020 18:24:04 +0100 Subject: [PATCH 1/6] Enable lazy-async-stacks by-default in all modes This was already enabled by-default in AOT mode in [0] - which made the gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks". See go/dart-10x-faster-async for more information. [0] https://github.com/flutter/flutter/commit/347823234fd --- runtime/dart_vm.cc | 3 ++- shell/common/switches.cc | 2 +- shell/platform/fuchsia/dart_runner/dart_runner.cc | 3 +-- shell/platform/fuchsia/dart_runner/embedder/BUILD.gn | 1 + shell/platform/fuchsia/dart_runner/kernel/BUILD.gn | 3 +-- shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn | 1 + shell/platform/fuchsia/flutter/component.cc | 4 +--- shell/platform/fuchsia/flutter/kernel/BUILD.gn | 3 +-- testing/scenario_app/compile_ios_jit.sh | 3 ++- testing/testing.gni | 3 ++- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 0a63ed80dbbe7..da0719787473f 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -60,7 +60,8 @@ static const char* kDartLanguageArgs[] = { // clang-format off "--enable_mirrors=false", "--background_compilation", - "--causal_async_stacks", + "--no-causal_async_stacks", + "--lazy_async_stacks", // clang-format on }; diff --git a/shell/common/switches.cc b/shell/common/switches.cc index a23e1156f5e5e..277fbd98cf62f 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -41,8 +41,8 @@ struct SwitchDesc { // clang-format off static const std::string gDartFlagsWhitelist[] = { - "--no-causal_async_stacks", "--lazy_async_stacks", + "--no-causal_async_stacks", }; // clang-format on diff --git a/shell/platform/fuchsia/dart_runner/dart_runner.cc b/shell/platform/fuchsia/dart_runner/dart_runner.cc index 74eb6b42401e8..2ba48164bcd60 100644 --- a/shell/platform/fuchsia/dart_runner/dart_runner.cc +++ b/shell/platform/fuchsia/dart_runner/dart_runner.cc @@ -35,8 +35,7 @@ namespace { const char* kDartVMArgs[] = { // clang-format off - // TODO(FL-117): Re-enable causal async stack traces when this issue is - // addressed. + "--lazy_async_stacks", "--no_causal_async_stacks", #if !defined(FLUTTER_PROFILE) diff --git a/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn b/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn index f47be6957910e..6c4173b863ad8 100644 --- a/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn +++ b/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn @@ -53,6 +53,7 @@ template("create_aot_snapshot") { args = [ "--no_causal_async_stacks", + "--lazy_async_stacks", "--deterministic", "--snapshot_kind=vm-aot-assembly", "--assembly=" + rebase_path(snapshot_assembly), diff --git a/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn b/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn index b54d26be43eb1..71c9d3a2050b6 100644 --- a/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn +++ b/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn @@ -71,9 +71,8 @@ template("create_kernel_core_snapshot") { tool = gen_snapshot_to_use args = [ - # TODO(FL-117): Re-enable causal async stack traces when this issue is - # addressed. "--no_causal_async_stacks", + "--lazy_async_stacks", "--use_bytecode_compiler", "--enable_mirrors=false", "--deterministic", diff --git a/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn b/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn index 53f4cf523e207..b0c2adc7b65e4 100644 --- a/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn +++ b/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn @@ -64,6 +64,7 @@ template("aot_snapshot") { args = [ "--no_causal_async_stacks", + "--lazy_async_stacks", "--deterministic", "--snapshot_kind=app-aot-elf", "--elf=" + rebase_path(snapshot_path), diff --git a/shell/platform/fuchsia/flutter/component.cc b/shell/platform/fuchsia/flutter/component.cc index 9f6bc6f91596c..026cc0555e451 100644 --- a/shell/platform/fuchsia/flutter/component.cc +++ b/shell/platform/fuchsia/flutter/component.cc @@ -353,9 +353,7 @@ Application::Application( settings_.task_observer_remove = std::bind( &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); - // TODO(FL-117): Re-enable causal async stack traces when this issue is - // addressed. - settings_.dart_flags = {"--no_causal_async_stacks"}; + settings_.dart_flags = {"--no_causal_async_stacks", "--lazy_async_stacks"}; // Disable code collection as it interferes with JIT code warmup // by decreasing usage counters and flushing code which is still useful. diff --git a/shell/platform/fuchsia/flutter/kernel/BUILD.gn b/shell/platform/fuchsia/flutter/kernel/BUILD.gn index 91bc01e0bf19f..fab808d477c45 100644 --- a/shell/platform/fuchsia/flutter/kernel/BUILD.gn +++ b/shell/platform/fuchsia/flutter/kernel/BUILD.gn @@ -75,9 +75,8 @@ template("core_snapshot") { tool = gen_snapshot_to_use args = [ - # TODO(FL-117): Re-enable causal async stack traces when this issue is - # addressed. "--no_causal_async_stacks", + "--lazy_async_stacks", "--use_bytecode_compiler", "--enable_mirrors=false", "--deterministic", diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index 6b3f25c3359b5..c3c2400f571c9 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -48,7 +48,8 @@ echo "Compiling JIT Snapshot..." "$DEVICE_TOOLS/gen_snapshot" --deterministic \ --enable-asserts \ - --causal_async_stacks \ + --no-causal_async_stacks \ + --lazy_async_stacks \ --isolate_snapshot_instructions="$OUTDIR/isolate_snapshot_instr" \ --snapshot_kind=app-jit \ --load_vm_snapshot_data="$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" \ diff --git a/testing/testing.gni b/testing/testing.gni index 5e06cd049cfd7..e53339f32cd2d 100644 --- a/testing/testing.gni +++ b/testing/testing.gni @@ -138,7 +138,8 @@ template("dart_snapshot_aot") { ] args = [ - "--causal_async_stacks", + "--no-causal_async_stacks", + "--lazy_async_stacks", "--deterministic", "--snapshot_kind=app-aot-elf", "--elf=" + rebase_path(elf_object), From 94cf1cf1f0857e93c0e59c4fe2204b4a52072d97 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Thu, 13 Feb 2020 11:58:57 +0100 Subject: [PATCH 2/6] Remove settings_.default_flags in shell/platform/fuchsia/flutter/component.cc --- shell/platform/fuchsia/flutter/component.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/shell/platform/fuchsia/flutter/component.cc b/shell/platform/fuchsia/flutter/component.cc index 026cc0555e451..4cd9485c9aedc 100644 --- a/shell/platform/fuchsia/flutter/component.cc +++ b/shell/platform/fuchsia/flutter/component.cc @@ -353,8 +353,6 @@ Application::Application( settings_.task_observer_remove = std::bind( &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); - settings_.dart_flags = {"--no_causal_async_stacks", "--lazy_async_stacks"}; - // Disable code collection as it interferes with JIT code warmup // by decreasing usage counters and flushing code which is still useful. settings_.dart_flags.push_back("--no-collect_code"); From 351704150ea0b6a954055838a8170f880f667ff8 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Thu, 13 Feb 2020 23:24:47 +0100 Subject: [PATCH 3/6] Update ShellTest_WhitelistedDartVMFlag to check for the two flags --- shell/common/shell_unittests.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index 26963e1c146be..c8cf5489038d8 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -281,16 +281,20 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { TEST_F(ShellTest, WhitelistedDartVMFlag) { const std::vector options = { fml::CommandLine::Option("dart-flags", - "--max_profile_depth 1,--random_seed 42")}; + "--lazy_async_stacks,--no-causal_async_stacks," + "--max_profile_depth 1,--random_seed 42")}; fml::CommandLine command_line("", options, std::vector()); flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); + EXPECT_GE(settings.dart_flags.size(), 2u); + EXPECT_EQ(settings.dart_flags[0], "--lazy_async_stacks"); + EXPECT_EQ(settings.dart_flags[1], "--no-causal_async_stacks"); #if !FLUTTER_RELEASE - EXPECT_EQ(settings.dart_flags.size(), 2u); - EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1"); - EXPECT_EQ(settings.dart_flags[1], "--random_seed 42"); + EXPECT_EQ(settings.dart_flags.size(), 4u); + EXPECT_EQ(settings.dart_flags[2], "--max_profile_depth 1"); + EXPECT_EQ(settings.dart_flags[3], "--random_seed 42"); #else - EXPECT_EQ(settings.dart_flags.size(), 0u); + EXPECT_EQ(settings.dart_flags.size(), 2u); #endif } From 70a817e6d64f495efe0ed030e2c6d135b8c02f97 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 19 Feb 2020 15:37:05 +0100 Subject: [PATCH 4/6] Ensure ./ci/format.sh works --- shell/common/shell_unittests.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index c8cf5489038d8..86b788ae8d543 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -281,8 +281,8 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { TEST_F(ShellTest, WhitelistedDartVMFlag) { const std::vector options = { fml::CommandLine::Option("dart-flags", - "--lazy_async_stacks,--no-causal_async_stacks," - "--max_profile_depth 1,--random_seed 42")}; + "--lazy_async_stacks,--no-causal_async_stacks," + "--max_profile_depth 1,--random_seed 42")}; fml::CommandLine command_line("", options, std::vector()); flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); From 706b09c9506620bce3714f04a902dc372cda77e8 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Thu, 20 Feb 2020 10:21:33 +0100 Subject: [PATCH 5/6] empty commit to re-trigger presubmit checks From 14e5334016d6195254119d4feabbe9b90f92d102 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Thu, 20 Feb 2020 16:58:45 +0100 Subject: [PATCH 6/6] empty commit to re-trigger presubmit checks