assemblyscript/tests/compiler/call-optional.optimized.wat

146 lines
2.9 KiB
Plaintext
Raw Normal View History

(module
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$v (func))
2019-06-05 23:15:39 +02:00
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
2019-06-05 23:15:39 +02:00
(data (i32.const 8) " \00\00\00\01\00\00\00\01\00\00\00 \00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
(table $0 2 funcref)
(elem (i32.const 0) $null $call-optional/opt|trampoline)
(global $~lib/argc (mut i32) (i32.const 0))
2019-06-05 23:15:39 +02:00
(global $call-optional/optIndirect i32 (i32.const 1))
(export "memory" (memory $0))
(start $start)
2019-06-05 23:15:39 +02:00
(func $call-optional/opt (; 1 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
local.get $0
local.get $1
i32.add
local.get $2
i32.add
)
(func $call-optional/opt|trampoline (; 2 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
block $2of2
block $1of2
block $0of2
block $outOfRange
global.get $~lib/argc
i32.const 1
i32.sub
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const -1
local.set $1
end
i32.const -2
local.set $2
end
local.get $0
local.get $1
local.get $2
2019-06-05 23:15:39 +02:00
call $call-optional/opt
)
2019-06-05 23:15:39 +02:00
(func $start:call-optional (; 3 ;) (type $FUNCSIG$v)
i32.const 1
global.set $~lib/argc
i32.const 3
2019-06-05 23:15:39 +02:00
i32.const 0
i32.const 0
call $call-optional/opt|trampoline
if
i32.const 0
2019-06-05 23:15:39 +02:00
i32.const 24
i32.const 4
i32.const 0
2019-06-05 23:15:39 +02:00
call $~lib/builtins/abort
unreachable
end
i32.const 2
global.set $~lib/argc
2019-06-05 23:15:39 +02:00
i32.const 3
i32.const 4
i32.const 0
2019-06-05 23:15:39 +02:00
call $call-optional/opt|trampoline
i32.const 5
i32.ne
if
i32.const 0
i32.const 24
i32.const 5
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 3
2019-06-05 23:15:39 +02:00
i32.const 4
i32.const 5
2019-06-05 23:15:39 +02:00
call $call-optional/opt
i32.const 12
i32.ne
if
i32.const 0
2019-06-05 23:15:39 +02:00
i32.const 24
i32.const 6
i32.const 0
2019-06-05 23:15:39 +02:00
call $~lib/builtins/abort
unreachable
end
i32.const 1
global.set $~lib/argc
i32.const 3
i32.const 0
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
if
i32.const 0
2019-06-05 23:15:39 +02:00
i32.const 24
i32.const 9
i32.const 0
2019-06-05 23:15:39 +02:00
call $~lib/builtins/abort
unreachable
end
i32.const 2
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
i32.const 5
i32.ne
if
i32.const 0
2019-06-05 23:15:39 +02:00
i32.const 24
i32.const 10
i32.const 0
2019-06-05 23:15:39 +02:00
call $~lib/builtins/abort
unreachable
end
i32.const 3
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 5
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
i32.const 12
i32.ne
if
i32.const 0
2019-06-05 23:15:39 +02:00
i32.const 24
i32.const 11
i32.const 0
2019-06-05 23:15:39 +02:00
call $~lib/builtins/abort
unreachable
end
)
2019-06-05 23:15:39 +02:00
(func $start (; 4 ;) (type $FUNCSIG$v)
call $start:call-optional
)
2019-06-05 23:15:39 +02:00
(func $null (; 5 ;) (type $FUNCSIG$v)
nop
)
)