Files
sdk/pkg/dart2wasm/test/ir_tests/deferred.init_at_startup.wat
T
Martin Kustermann 1d8d507384 [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 <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-04-29 05:16:01 -07:00

61 lines
3.5 KiB
WebAssembly Text Format

(module $module0
(type $#Top <...>)
(type $ArgumentError <...>)
(type $Array<Object?> <...>)
(type $Array<String> <...>)
(type $Array<int> <...>)
(type $JSExternWrapper <...>)
(type $Object <...>)
(func $"wasm:js-string.charCodeAt (import)" (import "wasm:js-string" "charCodeAt") (param externref i32) (result i32))
(@binaryen.removable.if.unused)
(func $"wasm:js-string.equals (import)" (import "wasm:js-string" "equals") (param externref externref) (result i32))
(@binaryen.removable.if.unused)
(func $"wasm:js-string.length (import)" (import "wasm:js-string" "length") (param externref) (result i32))
(table $cross-module-funcs-0 (export "cross-module-funcs-0") 18 funcref)
(global $"\"1.0\"" (ref $JSExternWrapper) <...>)
(global $BoxedDouble._cacheKeys (mut (ref $Array<int>)) <...>)
(global $BoxedDouble._cacheValues (mut (ref $Array<String>)) <...>)
(global $_deletedDataMarker (mut (ref $#Top)) <...>)
(elem $cross-module-funcs-0
(set 3 (ref.func $"wasm:js-string.length (import)"))
(set 4 (ref.func $JSStringImpl._interpolate))
(set 5 (ref.func $"_throwIndexError <noInline>"))
(set 6 (ref.func $"wasm:js-string.charCodeAt (import)"))
(set 7 (ref.func $JSStringImpl.substring))
(set 8 (ref.func $JSStringImpl.+))
(set 9 (ref.func $ArgumentError))
(set 10 (ref.func $"Error._throwWithCurrentStackTrace <noInline>"))
(set 11 (ref.func $JSStringImpl.fromRefUnchecked))
(set 12 (ref.func $"_throwRangeError <noInline>"))
(set 13 (ref.func $_jsBigIntToString))
(set 14 (ref.func $"wasm:js-string.equals (import)"))
(set 15 (ref.func $JSStringImpl._interpolate4))
(set 16 (ref.func $IntegerDivisionByZeroException))
(set 17 (ref.func $"_TypeError._throwNullCheckErrorWithCurrentStack <noInline>")))
(func $Error._throwWithCurrentStackTrace <noInline> (param $var0 (ref $#Top)) <...>)
(func $_TypeError._throwNullCheckErrorWithCurrentStack <noInline> <...>)
(func $_throwIndexError <noInline> (param $var0 i64) (param $var1 i64) (param $var2 (ref null $JSExternWrapper)) <...>)
(func $_throwRangeError <noInline> (param $var0 i64) (param $var1 i64) (param $var2 i64) (param $var3 (ref null $JSExternWrapper)) (param $var4 (ref null $JSExternWrapper)) <...>)
(func $#init
global.get $"\"1.0\""
i32.const 16
array.new $Array<String>
global.set $BoxedDouble._cacheValues
i64.const 4607182418800017408
i32.const 16
array.new $Array<int>
global.set $BoxedDouble._cacheKeys
i32.const 1
i32.const 0
struct.new $Object
global.set $_deletedDataMarker
)
(func $ArgumentError (param $var0 (ref null $#Top)) (param $var1 (ref null $JSExternWrapper)) (result (ref $ArgumentError)) <...>)
(func $IntegerDivisionByZeroException (result (ref $Object)) <...>)
(func $JSStringImpl.+ (param $var0 (ref $JSExternWrapper)) (param $var1 (ref $JSExternWrapper)) (result (ref $JSExternWrapper)) <...>)
(func $JSStringImpl._interpolate (param $var0 (ref $Array<Object?>)) (result (ref $JSExternWrapper)) <...>)
(func $JSStringImpl._interpolate4 (param $var0 (ref null $#Top)) (param $var1 (ref null $#Top)) (param $var2 (ref null $#Top)) (param $var3 (ref null $#Top)) (result (ref $JSExternWrapper)) <...>)
(func $JSStringImpl.fromRefUnchecked (param $var0 externref) (result (ref $JSExternWrapper)) <...>)
(func $JSStringImpl.substring (param $var0 (ref $JSExternWrapper)) (param $var1 i64) (param $var2 i64) (result (ref $JSExternWrapper)) <...>)
(func $_jsBigIntToString (param $var0 i64) (param $var1 i64) (result (ref $JSExternWrapper)) <...>)
)