5cd42e6b21
Binaryen introduced `binaryen.inline` which allows us to tell it inlining hints now, including "never inline" hint (see [0]) This allows us to remove the ugly mangling of wasm function names with `<noInline>` postfix. We also now pass `--strip-toolchain-annotations`: The annotations occupy size in the wasm binary and wasm runtimes ignore them (they are for `wams-opt` only). Except for IR tests: Here we want to see the annotations, so we keep them there. We also rename the package:wasm_builder classes to clearly indicate those are binaryen specific sections. We also make the ir_test.dart put it's options first, allowing the IR tests to override options if needed. [0] https://github.com/WebAssembly/binaryen/commit/3c25487214600a9 Change-Id: I96688bfaeba403a39cd5e7376f8d2889bcbae030 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510000 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Srujan Gaddam <srujzs@google.com>
72 lines
2.4 KiB
WebAssembly Text Format
72 lines
2.4 KiB
WebAssembly Text Format
(module $module0
|
|
(type $#Top (struct
|
|
(field $field0 i32)))
|
|
(type $JSExternWrapper (sub $#Top (struct
|
|
(field $field0 i32)
|
|
(field $_externRef externref))))
|
|
(func $"dart2wasm.M (import)" (import "dart2wasm" "M") (param externref) (result externref))
|
|
(func $"dart2wasm.P (import)" (import "dart2wasm" "P") (param externref) (result externref))
|
|
(global $.a (import "" "a") (ref extern))
|
|
(global $"stringValueNullable initialized" (mut i32) <...>)
|
|
(global $stringValueNullable (mut (ref null $JSExternWrapper)) <...>)
|
|
(func $ktrue implicit getter (result i32) <...>)
|
|
(func $new JSStringImpl.fromRef (param $var0 externref) (result (ref $JSExternWrapper)) <...>)
|
|
(func $stringValue implicit getter (result (ref $JSExternWrapper)) <...>)
|
|
(func $JSStringImpl.fromRefNullable (param $var0 externref) (result (ref null $JSExternWrapper)) <...>)
|
|
(func $sinkString (param $var0 (ref $JSExternWrapper)) <...>)
|
|
(func $sinkStringNullable (param $var0 (ref null $JSExternWrapper)) <...>)
|
|
(@binaryen.inline 0)
|
|
(func $testStringConstant
|
|
global.get $.a
|
|
call $"dart2wasm.P (import)"
|
|
call $"new JSStringImpl.fromRef"
|
|
call $sinkString
|
|
)
|
|
(@binaryen.inline 0)
|
|
(func $testStringConstantNullable
|
|
ref.null noextern
|
|
call $"dart2wasm.M (import)"
|
|
call $JSStringImpl.fromRefNullable
|
|
call $sinkStringNullable
|
|
)
|
|
(@binaryen.inline 0)
|
|
(func $testStringValue
|
|
call $"stringValue implicit getter"
|
|
struct.get $JSExternWrapper $_externRef
|
|
call $"dart2wasm.P (import)"
|
|
call $"new JSStringImpl.fromRef"
|
|
call $sinkString
|
|
)
|
|
(@binaryen.inline 0)
|
|
(func $testStringValueNullable
|
|
(local $var0 (ref null $JSExternWrapper))
|
|
(local $var1 (ref null $JSExternWrapper))
|
|
global.get $"stringValueNullable initialized"
|
|
if (result (ref null $JSExternWrapper))
|
|
global.get $stringValueNullable
|
|
else
|
|
call $"ktrue implicit getter"
|
|
if (result (ref null $JSExternWrapper))
|
|
call $"stringValue implicit getter"
|
|
else
|
|
ref.null none
|
|
end
|
|
local.tee $var0
|
|
global.set $stringValueNullable
|
|
i32.const 1
|
|
global.set $"stringValueNullable initialized"
|
|
local.get $var0
|
|
end
|
|
local.tee $var1
|
|
ref.is_null
|
|
if (result externref)
|
|
ref.null noextern
|
|
else
|
|
local.get $var1
|
|
struct.get $JSExternWrapper $_externRef
|
|
end
|
|
call $"dart2wasm.M (import)"
|
|
call $JSStringImpl.fromRefNullable
|
|
call $sinkStringNullable
|
|
)
|
|
) |