Skip to content

Commit 5320733

Browse files
committed
Merge branch 'master' of github.com:AssemblyScript/assemblyscript
2 parents ea8c884 + 201bd5f commit 5320733

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+14148
-6773
lines changed

dist/asc.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/asc.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assemblyscript.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-27 Bytes
Binary file not shown.

examples/game-of-life/build/optimized.wat

+66-87
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
get_local $1
2929
i32.mul
3030
set_global $assembly/index/s
31-
block $break|0
32-
i32.const 0
33-
set_local $0
34-
loop $repeat|0
31+
i32.const 0
32+
set_local $0
33+
loop $repeat|0
34+
block $break|0
3535
get_local $0
3636
get_global $assembly/index/h
3737
i32.ge_s
3838
br_if $break|0
39-
block $break|1
40-
i32.const 0
41-
set_local $1
42-
loop $repeat|1
39+
i32.const 0
40+
set_local $1
41+
loop $repeat|1
42+
block $break|1
4343
get_local $1
4444
get_global $assembly/index/w
4545
i32.ge_s
@@ -58,8 +58,8 @@
5858
end
5959
set_local $2
6060
get_global $assembly/index/s
61-
get_local $0
6261
get_global $assembly/index/w
62+
get_local $0
6363
i32.mul
6464
i32.add
6565
get_local $1
@@ -73,18 +73,14 @@
7373
i32.add
7474
set_local $1
7575
br $repeat|1
76-
unreachable
7776
end
78-
unreachable
7977
end
8078
get_local $0
8179
i32.const 1
8280
i32.add
8381
set_local $0
8482
br $repeat|0
85-
unreachable
8683
end
87-
unreachable
8884
end
8985
)
9086
(func $assembly/index/step (; 2 ;) (type $v)
@@ -104,61 +100,54 @@
104100
i32.const 1
105101
i32.sub
106102
set_local $7
107-
block $break|0
108-
loop $repeat|0
103+
loop $repeat|0
104+
block $break|0
109105
get_local $0
110106
get_global $assembly/index/h
111107
i32.ge_s
112108
br_if $break|0
113109
get_local $0
114-
if (result i32)
115-
get_local $0
116-
i32.const 1
117-
i32.sub
118-
else
119-
get_local $6
120-
end
121-
tee_local $2
110+
i32.const 1
111+
i32.sub
112+
get_local $6
113+
get_local $0
114+
select
122115
set_local $4
116+
i32.const 0
117+
get_local $0
118+
i32.const 1
119+
i32.add
123120
get_local $0
124121
get_local $6
125122
i32.eq
126-
if (result i32)
127-
i32.const 0
128-
else
129-
get_local $0
130-
i32.const 1
131-
i32.add
132-
end
123+
select
133124
set_local $5
134-
block $break|1
135-
i32.const 0
136-
set_local $1
137-
loop $repeat|1
125+
i32.const 0
126+
set_local $1
127+
loop $repeat|1
128+
block $break|1
138129
get_local $1
139130
get_global $assembly/index/w
140131
i32.ge_s
141132
br_if $break|1
142-
get_local $4
143-
get_global $assembly/index/w
144-
i32.mul
145133
get_local $1
146-
if (result i32)
147-
get_local $1
148-
i32.const 1
149-
i32.sub
150-
else
151-
get_local $7
152-
end
134+
i32.const 1
135+
i32.sub
136+
get_local $7
137+
get_local $1
138+
select
153139
tee_local $2
140+
get_global $assembly/index/w
141+
get_local $4
142+
i32.mul
154143
i32.add
155144
i32.const 2
156145
i32.shl
157146
i32.load
158147
i32.const 1
159148
i32.and
160-
get_local $4
161149
get_global $assembly/index/w
150+
get_local $4
162151
i32.mul
163152
get_local $1
164153
i32.add
@@ -168,29 +157,27 @@
168157
i32.const 1
169158
i32.and
170159
i32.add
171-
get_local $4
172-
get_global $assembly/index/w
173-
i32.mul
160+
i32.const 0
161+
get_local $1
162+
i32.const 1
163+
i32.add
174164
get_local $1
175165
get_local $7
176166
i32.eq
177-
if (result i32)
178-
i32.const 0
179-
else
180-
get_local $1
181-
i32.const 1
182-
i32.add
183-
end
167+
select
184168
tee_local $3
169+
get_global $assembly/index/w
170+
get_local $4
171+
i32.mul
185172
i32.add
186173
i32.const 2
187174
i32.shl
188175
i32.load
189176
i32.const 1
190177
i32.and
191178
i32.add
192-
get_local $0
193179
get_global $assembly/index/w
180+
get_local $0
194181
i32.mul
195182
get_local $2
196183
i32.add
@@ -200,8 +187,8 @@
200187
i32.const 1
201188
i32.and
202189
i32.add
203-
get_local $0
204190
get_global $assembly/index/w
191+
get_local $0
205192
i32.mul
206193
get_local $3
207194
i32.add
@@ -211,8 +198,8 @@
211198
i32.const 1
212199
i32.and
213200
i32.add
214-
get_local $5
215201
get_global $assembly/index/w
202+
get_local $5
216203
i32.mul
217204
get_local $2
218205
i32.add
@@ -222,8 +209,8 @@
222209
i32.const 1
223210
i32.and
224211
i32.add
225-
get_local $5
226212
get_global $assembly/index/w
213+
get_local $5
227214
i32.mul
228215
get_local $1
229216
i32.add
@@ -233,8 +220,8 @@
233220
i32.const 1
234221
i32.and
235222
i32.add
236-
get_local $5
237223
get_global $assembly/index/w
224+
get_local $5
238225
i32.mul
239226
get_local $3
240227
i32.add
@@ -245,8 +232,8 @@
245232
i32.and
246233
i32.add
247234
set_local $2
248-
get_local $0
249235
get_global $assembly/index/w
236+
get_local $0
250237
i32.mul
251238
get_local $1
252239
i32.add
@@ -264,15 +251,18 @@
264251
i32.eq
265252
if
266253
get_global $assembly/index/s
267-
get_local $0
268254
get_global $assembly/index/w
255+
get_local $0
269256
i32.mul
270257
i32.add
271258
get_local $1
272259
i32.add
273260
i32.const 2
274261
i32.shl
275262
get_local $3
263+
i32.const 16777215
264+
i32.and
265+
get_local $3
276266
i32.const 24
277267
i32.shr_u
278268
get_global $assembly/config/BIT_ROT
@@ -285,15 +275,12 @@
285275
select
286276
i32.const 24
287277
i32.shl
288-
get_local $3
289-
i32.const 16777215
290-
i32.and
291278
i32.or
292279
i32.store
293280
else
294281
get_global $assembly/index/s
295-
get_local $0
296282
get_global $assembly/index/w
283+
get_local $0
297284
i32.mul
298285
i32.add
299286
get_local $1
@@ -311,8 +298,8 @@
311298
i32.eq
312299
if
313300
get_global $assembly/index/s
314-
get_local $0
315301
get_global $assembly/index/w
302+
get_local $0
316303
i32.mul
317304
i32.add
318305
get_local $1
@@ -325,15 +312,18 @@
325312
i32.store
326313
else
327314
get_global $assembly/index/s
328-
get_local $0
329315
get_global $assembly/index/w
316+
get_local $0
330317
i32.mul
331318
i32.add
332319
get_local $1
333320
i32.add
334321
i32.const 2
335322
i32.shl
336323
get_local $3
324+
i32.const 16777215
325+
i32.and
326+
get_local $3
337327
i32.const 24
338328
i32.shr_u
339329
get_global $assembly/config/BIT_ROT
@@ -346,9 +336,6 @@
346336
select
347337
i32.const 24
348338
i32.shl
349-
get_local $3
350-
i32.const 16777215
351-
i32.and
352339
i32.or
353340
i32.store
354341
end
@@ -358,24 +345,20 @@
358345
i32.add
359346
set_local $1
360347
br $repeat|1
361-
unreachable
362348
end
363-
unreachable
364349
end
365350
get_local $0
366351
i32.const 1
367352
i32.add
368353
set_local $0
369354
br $repeat|0
370-
unreachable
371355
end
372-
unreachable
373356
end
374357
)
375358
(func $assembly/index/fill (; 3 ;) (type $iiFv) (param $0 i32) (param $1 i32) (param $2 f64)
376359
(local $3 i32)
377-
block $break|0
378-
loop $repeat|0
360+
loop $repeat|0
361+
block $break|0
379362
get_local $3
380363
get_global $assembly/index/w
381364
i32.ge_s
@@ -385,8 +368,8 @@
385368
f64.lt
386369
if
387370
get_global $assembly/index/s
388-
get_local $1
389371
get_global $assembly/index/w
372+
get_local $1
390373
i32.mul
391374
i32.add
392375
get_local $3
@@ -403,14 +386,12 @@
403386
i32.add
404387
set_local $3
405388
br $repeat|0
406-
unreachable
407389
end
408-
unreachable
409390
end
410-
block $break|1
411-
i32.const 0
412-
set_local $3
413-
loop $repeat|1
391+
i32.const 0
392+
set_local $3
393+
loop $repeat|1
394+
block $break|1
414395
get_local $3
415396
get_global $assembly/index/h
416397
i32.ge_s
@@ -420,8 +401,8 @@
420401
f64.lt
421402
if
422403
get_global $assembly/index/s
423-
get_local $3
424404
get_global $assembly/index/w
405+
get_local $3
425406
i32.mul
426407
i32.add
427408
get_local $0
@@ -438,9 +419,7 @@
438419
i32.add
439420
set_local $3
440421
br $repeat|1
441-
unreachable
442422
end
443-
unreachable
444423
end
445424
)
446425
(func $null (; 4 ;) (type $v)

0 commit comments

Comments
 (0)