forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-overloading.optimized.wat
223 lines (223 loc) Β· 4.66 KB
/
class-overloading.optimized.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
(module
(type $none_=>_none (func))
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 1024) "(\00\00\00\01\00\00\00\01\00\00\00(\00\00\00c\00l\00a\00s\00s\00-\00o\00v\00e\00r\00l\00o\00a\00d\00i\00n\00g\00.\00t\00s")
(global $class-overloading/itWorks (mut i32) (i32.const 0))
(global $~lib/rt/stub/startOffset (mut i32) (i32.const 0))
(global $~lib/rt/stub/offset (mut i32) (i32.const 0))
(global $class-overloading/foo (mut i32) (i32.const 0))
(global $class-overloading/afoo (mut i32) (i32.const 0))
(export "memory" (memory $0))
(start $~start)
(func $~lib/rt/stub/__alloc (; 1 ;) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
global.get $~lib/rt/stub/offset
i32.const 16
i32.add
local.tee $3
i32.const 16
i32.add
local.tee $1
memory.size
local.tee $4
i32.const 16
i32.shl
local.tee $2
i32.gt_u
if
local.get $4
local.get $1
local.get $2
i32.sub
i32.const 65535
i32.add
i32.const -65536
i32.and
i32.const 16
i32.shr_u
local.tee $2
local.get $4
local.get $2
i32.gt_s
select
memory.grow
i32.const 0
i32.lt_s
if
local.get $2
memory.grow
i32.const 0
i32.lt_s
if
unreachable
end
end
end
local.get $1
global.set $~lib/rt/stub/offset
local.get $3
i32.const 16
i32.sub
local.tee $1
i32.const 16
i32.store
local.get $1
i32.const 1
i32.store offset=4
local.get $1
local.get $0
i32.store offset=8
local.get $1
i32.const 0
i32.store offset=12
local.get $3
)
(func $class-overloading/Bar#constructor (; 2 ;) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
i32.const 4
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
i32.eqz
if
i32.const 5
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
i32.eqz
if
i32.const 6
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
)
(func $class-overloading/Foo#a<i32> (; 3 ;)
i32.const 0
i32.const 1040
i32.const 9
i32.const 5
call $~lib/builtins/abort
unreachable
)
(func $start:class-overloading (; 4 ;)
(local $0 i32)
i32.const 1088
global.set $~lib/rt/stub/startOffset
i32.const 1088
global.set $~lib/rt/stub/offset
i32.const 3
call $~lib/rt/stub/__alloc
call $class-overloading/Bar#constructor
drop
i32.const 0
call $class-overloading/Bar#constructor
global.set $class-overloading/foo
block $__inlined_func$class-overloading/Foo#a<i32>|virtual
block $self
block $id3
global.get $class-overloading/foo
i32.const 8
i32.sub
i32.load
local.tee $0
i32.const 4
i32.ne
if
local.get $0
i32.const 3
i32.eq
br_if $id3
local.get $0
i32.const 5
i32.eq
br_if $self
unreachable
end
i32.const 1
global.set $class-overloading/itWorks
br $__inlined_func$class-overloading/Foo#a<i32>|virtual
end
call $class-overloading/Baz#a<i32>
br $__inlined_func$class-overloading/Foo#a<i32>|virtual
end
call $class-overloading/Foo#a<i32>
end
global.get $class-overloading/itWorks
i32.eqz
if
i32.const 0
i32.const 1040
i32.const 28
i32.const 1
call $~lib/builtins/abort
unreachable
end
i32.const 0
call $class-overloading/Bar#constructor
global.set $class-overloading/afoo
block $__inlined_func$class-overloading/AbstractFoo#a<i32>|virtual
block $self0
block $id31
block $id4
global.get $class-overloading/afoo
i32.const 8
i32.sub
i32.load
local.tee $0
i32.const 5
i32.ne
if
block $tablify|0
local.get $0
i32.const 3
i32.sub
br_table $id31 $id4 $tablify|0 $self0 $tablify|0
end
unreachable
end
call $class-overloading/Foo#a<i32>
br $__inlined_func$class-overloading/AbstractFoo#a<i32>|virtual
end
i32.const 1
global.set $class-overloading/itWorks
br $__inlined_func$class-overloading/AbstractFoo#a<i32>|virtual
end
call $class-overloading/Baz#a<i32>
br $__inlined_func$class-overloading/AbstractFoo#a<i32>|virtual
end
unreachable
end
global.get $class-overloading/itWorks
i32.eqz
if
i32.const 0
i32.const 1040
i32.const 32
i32.const 1
call $~lib/builtins/abort
unreachable
end
)
(func $~start (; 5 ;)
call $start:class-overloading
)
(func $class-overloading/Baz#a<i32> (; 6 ;)
i32.const 0
i32.const 1040
i32.const 21
i32.const 5
call $~lib/builtins/abort
unreachable
)
)