forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn.debug.wat
106 lines (106 loc) · 2.56 KB
/
return.debug.wat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
(module
(type $0 (func))
(type $1 (func (param i32 i32)))
(type $2 (func (param i32)))
(type $3 (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(global $~argumentsLength (mut i32) (i32.const 0))
(global $~lib/memory/__data_end i32 (i32.const 44))
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32812))
(global $~lib/memory/__heap_base i32 (i32.const 32812))
(memory $0 1)
(data $0 (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\08\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00")
(table $0 2 2 funcref)
(elem $0 (i32.const 1) $start:return~anonymous|0)
(export "testVoidReturn" (func $return/testVoidReturn))
(export "memory" (memory $0))
(export "testVoidReturnFunction" (func $export:return/testVoidReturnFunction))
(start $~start)
(func $return/nop
)
(func $start:return~anonymous|0
call $return/nop
)
(func $return/testVoidReturnFunction (param $cond i32) (param $fn i32)
local.get $cond
if
i32.const 0
global.set $~argumentsLength
local.get $fn
i32.load
call_indirect (type $0)
return
end
i32.const 0
global.set $~argumentsLength
local.get $fn
i32.load
call_indirect (type $0)
return
)
(func $return/testVoidReturn (param $cond i32)
local.get $cond
if
call $return/nop
return
end
call $return/nop
return
)
(func $~start
call $start:return
)
(func $~stack_check
global.get $~lib/memory/__stack_pointer
global.get $~lib/memory/__data_end
i32.lt_s
if
i32.const 32832
i32.const 32880
i32.const 1
i32.const 1
call $~lib/builtins/abort
unreachable
end
)
(func $start:return
(local $0 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
global.set $~lib/memory/__stack_pointer
call $~stack_check
global.get $~lib/memory/__stack_pointer
i32.const 0
i32.store
i32.const 1
i32.const 32
local.set $0
global.get $~lib/memory/__stack_pointer
local.get $0
i32.store
local.get $0
call $return/testVoidReturnFunction
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
)
(func $export:return/testVoidReturnFunction (param $0 i32) (param $1 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
global.set $~lib/memory/__stack_pointer
call $~stack_check
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $0
local.get $1
call $return/testVoidReturnFunction
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
)
)