56e0c9fca3
This reduces e main module by around -0.4% uncompressed and -0.5% compressed Value types don't have identiy, they are compared by value. As such there's no need to have a unique int/double box for the same value - each module can have their own box: The box identity cannot observed. That in return means also we avoid exporting those from main module & importing into deferred modules. Change-Id: Ib63949b59263b7381396323210b4218662f56525 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509321 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Srujan Gaddam <srujzs@google.com>
153 lines
5.2 KiB
WebAssembly Text Format
153 lines
5.2 KiB
WebAssembly Text Format
(module $module1
|
|
(type $#Top <...>)
|
|
(type $BoxedInt <...>)
|
|
(type $JSExternWrapper <...>)
|
|
(type $Object <...>)
|
|
(global $".Foo0.doitDispatch(" (import "" "Foo0.doitDispatch(") (ref extern))
|
|
(global $".Foo1.doitDevirt(" (import "" "Foo1.doitDevirt(") (ref extern))
|
|
(global $".Foo1.doitDispatch(" (import "" "Foo1.doitDispatch(") (ref extern))
|
|
(global $".FooBase(" (import "" "FooBase(") (ref extern))
|
|
(global $"\")\"" (import "module0" "global2") (ref $JSExternWrapper))
|
|
(table $module0.cross-module-funcs-0 (import "module0" "cross-module-funcs-0") 18 funcref)
|
|
(table $module0.dispatch0 (import "module0" "dispatch0") 657 funcref)
|
|
(global $"\"Foo0.doitDispatch(\"" (ref $JSExternWrapper)
|
|
(i32.const 60)
|
|
(i32.const 0)
|
|
(global.get $".Foo0.doitDispatch(")
|
|
(struct.new $JSExternWrapper))
|
|
(global $"\"Foo1.doitDevirt(\"" (ref $JSExternWrapper)
|
|
(i32.const 60)
|
|
(i32.const 0)
|
|
(global.get $".Foo1.doitDevirt(")
|
|
(struct.new $JSExternWrapper))
|
|
(global $"\"Foo1.doitDispatch(\"" (ref $JSExternWrapper)
|
|
(i32.const 60)
|
|
(i32.const 0)
|
|
(global.get $".Foo1.doitDispatch(")
|
|
(struct.new $JSExternWrapper))
|
|
(global $"\"FooBase(\"" (ref $JSExternWrapper)
|
|
(i32.const 60)
|
|
(i32.const 0)
|
|
(global.get $".FooBase(")
|
|
(struct.new $JSExternWrapper))
|
|
(global $1 (ref $BoxedInt) <...>)
|
|
(global $2 (ref $BoxedInt) <...>)
|
|
(global $baseObj (mut (ref null $Object)) <...>)
|
|
(global $foo1Obj (mut (ref null $Object)) <...>)
|
|
(elem $module0.cross-module-funcs-0
|
|
(set 0 (ref.func $"runtimeTrue implicit getter"))
|
|
(set 1 (ref.func $"foo1 <noInline>"))
|
|
(set 2 (ref.func $"foo0 <noInline>")))
|
|
(elem $module0.dispatch0 <...>)
|
|
(func $"foo0 <noInline>"
|
|
call $"runtimeTrue implicit getter"
|
|
if (result (ref $Object))
|
|
i32.const 109
|
|
i32.const 0
|
|
struct.new $Object
|
|
else
|
|
call $Foo1
|
|
end
|
|
global.set $baseObj
|
|
call $"runtimeTrue implicit getter"
|
|
drop
|
|
call $Foo1
|
|
global.set $foo1Obj
|
|
i64.const 0
|
|
i32.const 3
|
|
call_indirect $module0.cross-module-funcs-0 (param i64) (result i32)
|
|
drop
|
|
call $"foo1 <noInline>"
|
|
)
|
|
(func $"foo1 <noInline>"
|
|
(local $var0 (ref $Object))
|
|
block $label0
|
|
block $label1 (result (ref $Object))
|
|
global.get $baseObj
|
|
br_on_non_null $label1
|
|
br $label0
|
|
end $label1
|
|
local.tee $var0
|
|
global.get $1
|
|
local.get $var0
|
|
struct.get $Object $field0
|
|
i32.const 399
|
|
i32.add
|
|
call_indirect $module0.dispatch0 (param (ref $Object) (ref null $#Top))
|
|
block $label2 (result (ref $Object))
|
|
global.get $foo1Obj
|
|
br_on_non_null $label2
|
|
br $label0
|
|
end $label2
|
|
global.get $2
|
|
call $Foo1.doitDispatch
|
|
block $label3 (result (ref $Object))
|
|
global.get $foo1Obj
|
|
br_on_non_null $label3
|
|
br $label0
|
|
end $label3
|
|
drop
|
|
call $Foo1.doitDevirt
|
|
block $label4 (result (ref $Object))
|
|
global.get $foo1Obj
|
|
br_on_non_null $label4
|
|
br $label0
|
|
end $label4
|
|
drop
|
|
call $Foo1.doitDevirt
|
|
return
|
|
end $label0
|
|
i32.const 4
|
|
call_indirect $module0.cross-module-funcs-0
|
|
unreachable
|
|
)
|
|
(func $runtimeTrue implicit getter (result i32) <...>)
|
|
(func $Foo0.doitDispatch (param $var0 (ref $Object)) (param $var1 (ref null $#Top))
|
|
global.get $"\"Foo0.doitDispatch(\""
|
|
local.get $var1
|
|
global.get $"\")\""
|
|
i32.const 5
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top) (ref null $#Top) (ref null $#Top)) (result (ref $JSExternWrapper))
|
|
i32.const 6
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top))
|
|
local.get $var1
|
|
call $FooBase.doitDispatch
|
|
)
|
|
(func $Foo1 (result (ref $Object)) <...>)
|
|
(func $Foo1.doitDevirt
|
|
global.get $"\"Foo1.doitDevirt(\""
|
|
global.get $1
|
|
global.get $"\")\""
|
|
i32.const 5
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top) (ref null $#Top) (ref null $#Top)) (result (ref $JSExternWrapper))
|
|
i32.const 6
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top))
|
|
global.get $"\"FooBase(\""
|
|
global.get $1
|
|
global.get $"\")\""
|
|
i32.const 5
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top) (ref null $#Top) (ref null $#Top)) (result (ref $JSExternWrapper))
|
|
i32.const 6
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top))
|
|
)
|
|
(func $Foo1.doitDispatch (param $var0 (ref $Object)) (param $var1 (ref null $#Top))
|
|
global.get $"\"Foo1.doitDispatch(\""
|
|
local.get $var1
|
|
global.get $"\")\""
|
|
i32.const 5
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top) (ref null $#Top) (ref null $#Top)) (result (ref $JSExternWrapper))
|
|
i32.const 6
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top))
|
|
local.get $var1
|
|
call $FooBase.doitDispatch
|
|
)
|
|
(func $FooBase.doitDispatch (param $var0 (ref null $#Top))
|
|
global.get $"\"FooBase(\""
|
|
local.get $var0
|
|
global.get $"\")\""
|
|
i32.const 5
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top) (ref null $#Top) (ref null $#Top)) (result (ref $JSExternWrapper))
|
|
i32.const 6
|
|
call_indirect $module0.cross-module-funcs-0 (param (ref null $#Top))
|
|
)
|
|
) |