Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 575a519

Browse files
author
Clement Skau
authored
Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)
Lazy async stacks were already enabled by-default in AOT mode in [0] - which made the gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks". This change does the same with the engine defaults, which makes this be enabled by-default in JIT mode as well. See go/dart-10x-faster-async for more information. This is a re-land: A fix for what we believe to have caused the last revert has landed upstream in Dart in dart-lang/sdk@0004589 [0] flutter/flutter@3478232
1 parent 5b055bb commit 575a519

File tree

10 files changed

+17
-16
lines changed

10 files changed

+17
-16
lines changed

runtime/dart_vm.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static const char* kDartLanguageArgs[] = {
5959
// clang-format off
6060
"--enable_mirrors=false",
6161
"--background_compilation",
62-
"--causal_async_stacks",
62+
"--no-causal_async_stacks",
63+
"--lazy_async_stacks",
6364
// clang-format on
6465
};
6566

shell/common/shell_unittests.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,19 @@ TEST_F(ShellTest, AllowedDartVMFlag) {
312312
const std::vector<fml::CommandLine::Option> options = {
313313
#if !FLUTTER_RELEASE
314314
fml::CommandLine::Option("dart-flags",
315+
"--lazy_async_stacks,--no-causal_async_stacks,"
315316
"--max_profile_depth 1,--random_seed 42")
316317
#endif
317318
};
318319
fml::CommandLine command_line("", options, std::vector<std::string>());
319320
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
320321

321322
#if !FLUTTER_RELEASE
322-
EXPECT_EQ(settings.dart_flags.size(), 2u);
323-
EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1");
324-
EXPECT_EQ(settings.dart_flags[1], "--random_seed 42");
323+
EXPECT_EQ(settings.dart_flags.size(), 4u);
324+
EXPECT_EQ(settings.dart_flags[0], "--lazy_async_stacks");
325+
EXPECT_EQ(settings.dart_flags[1], "--no-causal_async_stacks");
326+
EXPECT_EQ(settings.dart_flags[2], "--max_profile_depth 1");
327+
EXPECT_EQ(settings.dart_flags[3], "--random_seed 42");
325328
#else
326329
EXPECT_EQ(settings.dart_flags.size(), 0u);
327330
#endif

shell/platform/fuchsia/dart_runner/dart_runner.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ namespace {
3535

3636
const char* kDartVMArgs[] = {
3737
// clang-format off
38-
// TODO(FL-117): Re-enable causal async stack traces when this issue is
39-
// addressed.
4038
"--no_causal_async_stacks",
39+
"--lazy_async_stacks",
4140

4241
"--systrace_timeline",
4342
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM",

shell/platform/fuchsia/dart_runner/embedder/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ template("create_aot_snapshot") {
4747

4848
args = [
4949
"--no_causal_async_stacks",
50+
"--lazy_async_stacks",
5051
"--deterministic",
5152
"--snapshot_kind=vm-aot-assembly",
5253
"--assembly=" + rebase_path(snapshot_assembly),

shell/platform/fuchsia/dart_runner/kernel/BUILD.gn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ template("create_kernel_core_snapshot") {
7272
tool = gen_snapshot_to_use
7373

7474
args = [
75-
# TODO(FL-117): Re-enable causal async stack traces when this issue is
76-
# addressed.
7775
"--no_causal_async_stacks",
76+
"--lazy_async_stacks",
7877
"--use_bytecode_compiler",
7978
"--enable_mirrors=false",
8079
"--deterministic",

shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ template("aot_snapshot") {
5858

5959
args = [
6060
"--no_causal_async_stacks",
61+
"--lazy_async_stacks",
6162
"--deterministic",
6263
"--snapshot_kind=app-aot-elf",
6364
"--elf=" + rebase_path(snapshot_path),

shell/platform/fuchsia/flutter/component.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,6 @@ Application::Application(
401401
settings_.task_observer_remove = std::bind(
402402
&CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1);
403403

404-
// TODO(FL-117): Re-enable causal async stack traces when this issue is
405-
// addressed.
406-
settings_.dart_flags = {"--no_causal_async_stacks"};
407-
408404
// Disable code collection as it interferes with JIT code warmup
409405
// by decreasing usage counters and flushing code which is still useful.
410406
settings_.dart_flags.push_back("--no-collect_code");

shell/platform/fuchsia/flutter/kernel/BUILD.gn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ template("core_snapshot") {
7676
tool = gen_snapshot_to_use
7777

7878
args = [
79-
# TODO(FL-117): Re-enable causal async stack traces when this issue is
80-
# addressed.
8179
"--no_causal_async_stacks",
80+
"--lazy_async_stacks",
8281
"--use_bytecode_compiler",
8382
"--enable_mirrors=false",
8483
"--deterministic",

testing/scenario_app/compile_ios_jit.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ echo "Compiling JIT Snapshot..."
7474

7575
"$DEVICE_TOOLS/gen_snapshot" --deterministic \
7676
--enable-asserts \
77-
--causal_async_stacks \
77+
--no-causal_async_stacks \
78+
--lazy_async_stacks \
7879
--isolate_snapshot_instructions="$OUTDIR/isolate_snapshot_instr" \
7980
--snapshot_kind=app-jit \
8081
--load_vm_snapshot_data="$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" \

testing/testing.gni

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ template("dart_snapshot_aot") {
128128
outputs = [ elf_object ]
129129

130130
args = [
131-
"--causal_async_stacks",
131+
"--no-causal_async_stacks",
132+
"--lazy_async_stacks",
132133
"--deterministic",
133134
"--snapshot_kind=app-aot-elf",
134135
"--elf=" + rebase_path(elf_object),

0 commit comments

Comments
 (0)