[dart-lang/sdk] 1d8d50: [dart2wasm] More precise inlining

0 views
Skip to first unread message

Martin Kustermann

unread,
8:18 AM (5 hours ago) 8:18 AM
to com...@dartlang.org
Branch: refs/heads/main
Home: https://github.com/dart-lang/sdk
Commit: 1d8d507384fb14641211eb51143593e1dc0e67fa
https://github.com/dart-lang/sdk/commit/1d8d507384fb14641211eb51143593e1dc0e67fa
Author: Martin Kustermann <kuste...@google.com>
Date: 2026-04-29 (Wed, 29 Apr 2026)

Changed paths:
M pkg/dart2wasm/lib/code_generator.dart
M pkg/dart2wasm/lib/translator.dart
M pkg/dart2wasm/lib/types.dart
M pkg/dart2wasm/test/ir_tests/deferred.constant_module1.wat
M pkg/dart2wasm/test/ir_tests/deferred.constant_module2.wat
M pkg/dart2wasm/test/ir_tests/deferred.fine_grained.wat
M pkg/dart2wasm/test/ir_tests/deferred.init_at_startup.wat
M pkg/dart2wasm/test/ir_tests/deferred.init_at_startup_module1.wat
M pkg/dart2wasm/test/ir_tests/deferred.type_checks_module1.wat
M pkg/dart2wasm/test/ir_tests/dyn_closure.wat
M pkg/dart2wasm/test/ir_tests/dyn_closure_function_apply.wat
M pkg/dart2wasm/test/ir_tests/dyn_closure_function_apply_named.wat
M pkg/wasm_builder/lib/src/builder/instructions.dart
M sdk/lib/_internal/wasm/lib/boxed_int_patch.dart
M sdk/lib/_internal/wasm/lib/type.dart
M sdk/lib/internal/iterable.dart

Log Message:
-----------
[dart2wasm] More precise inlining

This reduces e main module by around -0.3%.

We make the inliner have more precision when estimating the
callee size, especially around constructors but also other
cases.

We are also less generous with budget for iterators, modulo list
iterators which we want to be always inlined.

We also print the inlining decisions in `--print-wasm`

In deferred loading scenario this now inlines constructor bodies
more often than before as the size estimate is better. That in
return avoids us e.g. exporting empty constructor body functions
in the main module to be imported by other modules.

CoreLibraryReviewExempt: Backend-specific function changes.
Change-Id: I320db6f976a5d8c036b40908a5f72e7019d420ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498562
Reviewed-by: Srujan Gaddam <sru...@google.com>
Commit-Queue: Martin Kustermann <kuste...@google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/dart-lang/sdk/settings/notifications

Martin Kustermann

unread,
9:37 AM (4 hours ago) 9:37 AM
to com...@dartlang.org
Branch: refs/heads/lkgr
Reply all
Reply to author
Forward
0 new messages