Skip to content

Commit fdabcad

Browse files
authored
Enable lazy-async-stacks by-default in all modes (flutter#16556)
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] flutter/flutter@347823234fd
1 parent 6b3d439 commit fdabcad

File tree

11 files changed

+20
-18
lines changed

11 files changed

+20
-18
lines changed

runtime/dart_vm.cc

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

shell/common/shell_unittests.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,20 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) {
281281
TEST_F(ShellTest, WhitelistedDartVMFlag) {
282282
const std::vector<fml::CommandLine::Option> options = {
283283
fml::CommandLine::Option("dart-flags",
284+
"--lazy_async_stacks,--no-causal_async_stacks,"
284285
"--max_profile_depth 1,--random_seed 42")};
285286
fml::CommandLine command_line("", options, std::vector<std::string>());
286287
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
287288

289+
EXPECT_GE(settings.dart_flags.size(), 2u);
290+
EXPECT_EQ(settings.dart_flags[0], "--lazy_async_stacks");
291+
EXPECT_EQ(settings.dart_flags[1], "--no-causal_async_stacks");
288292
#if !FLUTTER_RELEASE
289-
EXPECT_EQ(settings.dart_flags.size(), 2u);
290-
EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1");
291-
EXPECT_EQ(settings.dart_flags[1], "--random_seed 42");
293+
EXPECT_EQ(settings.dart_flags.size(), 4u);
294+
EXPECT_EQ(settings.dart_flags[2], "--max_profile_depth 1");
295+
EXPECT_EQ(settings.dart_flags[3], "--random_seed 42");
292296
#else
293-
EXPECT_EQ(settings.dart_flags.size(), 0u);
297+
EXPECT_EQ(settings.dart_flags.size(), 2u);
294298
#endif
295299
}
296300

shell/common/switches.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ struct SwitchDesc {
4141

4242
// clang-format off
4343
static const std::string gDartFlagsWhitelist[] = {
44-
"--no-causal_async_stacks",
4544
"--lazy_async_stacks",
45+
"--no-causal_async_stacks",
4646
};
4747
// clang-format on
4848

shell/platform/fuchsia/dart_runner/dart_runner.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ 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.
38+
"--lazy_async_stacks",
4039
"--no_causal_async_stacks",
4140

4241
#if !defined(FLUTTER_PROFILE)

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

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

5454
args = [
5555
"--no_causal_async_stacks",
56+
"--lazy_async_stacks",
5657
"--deterministic",
5758
"--snapshot_kind=vm-aot-assembly",
5859
"--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
@@ -71,9 +71,8 @@ template("create_kernel_core_snapshot") {
7171
tool = gen_snapshot_to_use
7272

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

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

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

6565
args = [
6666
"--no_causal_async_stacks",
67+
"--lazy_async_stacks",
6768
"--deterministic",
6869
"--snapshot_kind=app-aot-elf",
6970
"--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
@@ -353,10 +353,6 @@ Application::Application(
353353
settings_.task_observer_remove = std::bind(
354354
&CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1);
355355

356-
// TODO(FL-117): Re-enable causal async stack traces when this issue is
357-
// addressed.
358-
settings_.dart_flags = {"--no_causal_async_stacks"};
359-
360356
// Disable code collection as it interferes with JIT code warmup
361357
// by decreasing usage counters and flushing code which is still useful.
362358
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
@@ -75,9 +75,8 @@ template("core_snapshot") {
7575
tool = gen_snapshot_to_use
7676

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

testing/scenario_app/compile_ios_jit.sh

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

4949
"$DEVICE_TOOLS/gen_snapshot" --deterministic \
5050
--enable-asserts \
51-
--causal_async_stacks \
51+
--no-causal_async_stacks \
52+
--lazy_async_stacks \
5253
--isolate_snapshot_instructions="$OUTDIR/isolate_snapshot_instr" \
5354
--snapshot_kind=app-jit \
5455
--load_vm_snapshot_data="$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" \

0 commit comments

Comments
 (0)