diff --git a/engine/src/flutter/runtime/dart_vm.cc b/engine/src/flutter/runtime/dart_vm.cc index 5ec079749f..fb44bc2b94 100644 --- a/engine/src/flutter/runtime/dart_vm.cc +++ b/engine/src/flutter/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/engine/src/flutter/shell/common/shell_unittests.cc b/engine/src/flutter/shell/common/shell_unittests.cc index f9ac952cc6..d9c348f5cd 100644 --- a/engine/src/flutter/shell/common/shell_unittests.cc +++ b/engine/src/flutter/shell/common/shell_unittests.cc @@ -312,6 +312,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 }; @@ -319,9 +320,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/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.cc index 0bc7d532ed..8442d11314 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.cc +++ b/engine/src/flutter/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", "--systrace_timeline", "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn index c237b97167..edbf3e4506 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/embedder/BUILD.gn @@ -47,6 +47,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/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn index 7bab46d615..c06ed33bd3 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/kernel/BUILD.gn @@ -72,9 +72,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/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn index 186feedd2d..ce44912e7d 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn @@ -58,6 +58,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/engine/src/flutter/shell/platform/fuchsia/flutter/component.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/component.cc index f7de2e9990..2c447aec69 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component.cc @@ -401,10 +401,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/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn index f221f4af19..0b7288cf28 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn @@ -76,9 +76,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/engine/src/flutter/testing/scenario_app/compile_ios_jit.sh b/engine/src/flutter/testing/scenario_app/compile_ios_jit.sh index 6c072066bf..12e5899ad0 100755 --- a/engine/src/flutter/testing/scenario_app/compile_ios_jit.sh +++ b/engine/src/flutter/testing/scenario_app/compile_ios_jit.sh @@ -74,7 +74,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/engine/src/flutter/testing/testing.gni b/engine/src/flutter/testing/testing.gni index 488310a050..ddab490566 100644 --- a/engine/src/flutter/testing/testing.gni +++ b/engine/src/flutter/testing/testing.gni @@ -128,7 +128,8 @@ template("dart_snapshot_aot") { outputs = [ elf_object ] args = [ - "--causal_async_stacks", + "--no-causal_async_stacks", + "--lazy_async_stacks", "--deterministic", "--snapshot_kind=app-aot-elf", "--elf=" + rebase_path(elf_object),