From d60d1ed25892e5d9130a1035cfc3b812cf62debc Mon Sep 17 00:00:00 2001 From: Clement Skau Date: Wed, 24 Jun 2020 13:36:34 +0200 Subject: [PATCH] Enable lazy-async-stacks by-default in all modes (2) --- runtime/dart_vm.cc | 3 ++- shell/common/shell_unittests.cc | 9 ++++++--- 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, 17 insertions(+), 16 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 85e16c6393f9d..0a35ca6eaa6c9 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -59,7 +59,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/shell_unittests.cc b/shell/common/shell_unittests.cc index a2b04b8a44543..a0ec51909006c 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -284,6 +284,7 @@ TEST_F(ShellTest, AllowedDartVMFlag) { const std::vector options = { #if !FLUTTER_RELEASE fml::CommandLine::Option("dart-flags", + "--lazy_async_stacks,--no-causal_async_stacks," "--max_profile_depth 1,--random_seed 42") #endif }; @@ -291,9 +292,11 @@ TEST_F(ShellTest, AllowedDartVMFlag) { flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); #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[0], "--lazy_async_stacks"); + EXPECT_EQ(settings.dart_flags[1], "--no-causal_async_stacks"); + 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); #endif diff --git a/shell/platform/fuchsia/dart_runner/dart_runner.cc b/shell/platform/fuchsia/dart_runner/dart_runner.cc index a2a8302b0b926..34d429bc74d00 100644 --- a/shell/platform/fuchsia/dart_runner/dart_runner.cc +++ b/shell/platform/fuchsia/dart_runner/dart_runner.cc @@ -35,9 +35,8 @@ namespace { const char* kDartVMArgs[] = { // clang-format off - // TODO(FL-117): Re-enable causal async stack traces when this issue is - // addressed. "--no_causal_async_stacks", + "--lazy_async_stacks", #if !defined(FLUTTER_PROFILE) "--systrace_timeline", 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 ac2cf86276020..6acacfff800ab 100644 --- a/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn +++ b/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn @@ -74,9 +74,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 00cd9d318ae83..19ec91c2a9eeb 100644 --- a/shell/platform/fuchsia/flutter/component.cc +++ b/shell/platform/fuchsia/flutter/component.cc @@ -392,10 +392,6 @@ 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"}; - // 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"); diff --git a/shell/platform/fuchsia/flutter/kernel/BUILD.gn b/shell/platform/fuchsia/flutter/kernel/BUILD.gn index e63891ad50fad..945a07bc47cd5 100644 --- a/shell/platform/fuchsia/flutter/kernel/BUILD.gn +++ b/shell/platform/fuchsia/flutter/kernel/BUILD.gn @@ -78,9 +78,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 21d69ed4da3d9..917b0414979de 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),