forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpointer.debug.wat
784 lines (784 loc) · 17.3 KB
/
pointer.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
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
(module
(type $0 (func (param i32 i32)))
(type $1 (func (param i32) (result i32)))
(type $2 (func))
(type $3 (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(global $std/pointer/one (mut i32) (i32.const 0))
(global $std/pointer/two (mut i32) (i32.const 0))
(global $std/pointer/add (mut i32) (i32.const 0))
(global $std/pointer/sub (mut i32) (i32.const 0))
(global $std/pointer/nextOne (mut i32) (i32.const 0))
(global $std/pointer/buf (mut i32) (i32.const 0))
(global $~lib/memory/__data_end i32 (i32.const 60))
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32828))
(global $~lib/memory/__heap_base i32 (i32.const 32828))
(memory $0 1)
(data $0 (i32.const 12) ",\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\1c\00\00\00s\00t\00d\00/\00p\00o\00i\00n\00t\00e\00r\00.\00t\00s\00")
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "memory" (memory $0))
(start $~start)
(func $std/pointer/Entry#set:key (param $this i32) (param $key i32)
local.get $this
local.get $key
i32.store
)
(func $std/pointer/Entry#set:val (param $this i32) (param $val i32)
local.get $this
local.get $val
i32.store offset=4
)
(func $std/pointer/Entry#get:key (param $this i32) (result i32)
local.get $this
i32.load
)
(func $std/pointer/Entry#get:val (param $this i32) (result i32)
local.get $this
i32.load offset=4
)
(func $start:std/pointer
(local $this i32)
(local $offset i32)
(local $this|2 i32)
(local $offset|3 i32)
(local $this|4 i32)
(local $this|5 i32)
(local $this|6 i32)
(local $this|7 i32)
(local $this|8 i32)
(local $this|9 i32)
(local $this|10 i32)
(local $other i32)
(local $this|12 i32)
(local $this|13 i32)
(local $other|14 i32)
(local $this|15 i32)
(local $this|16 i32)
(local $this|17 i32)
(local $this|18 i32)
(local $this|19 i32)
(local $this|20 i32)
(local $this|21 i32)
(local $this|22 i32)
(local $this|23 i32)
(local $this|24 i32)
(local $this|25 i32)
(local $this|26 i32)
(local $value i32)
(local $this|28 i32)
(local $this|29 i32)
(local $this|30 i32)
(local $this|31 i32)
(local $this|32 i32)
(local $offset|33 i32)
(local $this|34 i32)
(local $index i32)
(local $value|36 f32)
(local $this|37 i32)
(local $index|38 i32)
(local $value|39 f32)
(local $this|40 i32)
(local $index|41 i32)
(local $this|42 i32)
(local $index|43 i32)
(local $this|44 i32)
(local $index|45 i32)
(local $this|46 i32)
(local $index|47 i32)
(local $this|48 i32)
(local $index|49 i32)
(local $value|50 f32)
(local $this|51 i32)
(local $index|52 i32)
(local $this|53 i32)
(local $index|54 i32)
(local $this|55 i32)
(local $value|56 f32)
(local $this|57 i32)
block $std/pointer/Pointer<std/pointer/Entry>#constructor|inlined.0 (result i32)
i32.const 0
local.set $this
i32.const 8
local.set $offset
local.get $offset
br $std/pointer/Pointer<std/pointer/Entry>#constructor|inlined.0
end
global.set $std/pointer/one
block $std/pointer/Pointer<std/pointer/Entry>#constructor|inlined.1 (result i32)
i32.const 0
local.set $this|2
i32.const 24
local.set $offset|3
local.get $offset|3
br $std/pointer/Pointer<std/pointer/Entry>#constructor|inlined.1
end
global.set $std/pointer/two
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.0 (result i32)
global.get $std/pointer/one
local.set $this|4
local.get $this|4
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.0
end
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 78
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.1 (result i32)
global.get $std/pointer/two
local.set $this|5
local.get $this|5
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.1
end
i32.const 24
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 79
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.0 (result i32)
global.get $std/pointer/one
local.set $this|6
i32.const 1
drop
local.get $this|6
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.0
end
i32.const 1
call $std/pointer/Entry#set:key
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.1 (result i32)
global.get $std/pointer/one
local.set $this|7
i32.const 1
drop
local.get $this|7
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.1
end
i32.const 2
call $std/pointer/Entry#set:val
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.2 (result i32)
global.get $std/pointer/one
local.set $this|8
i32.const 1
drop
local.get $this|8
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.2
end
call $std/pointer/Entry#get:key
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 83
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.3 (result i32)
global.get $std/pointer/one
local.set $this|9
i32.const 1
drop
local.get $this|9
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.3
end
call $std/pointer/Entry#get:val
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 84
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#add|inlined.0 (result i32)
global.get $std/pointer/one
local.set $this|10
global.get $std/pointer/two
local.set $other
local.get $this|10
local.get $other
i32.add
br $std/pointer/Pointer<std/pointer/Entry>#add|inlined.0
end
global.set $std/pointer/add
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.2 (result i32)
global.get $std/pointer/add
local.set $this|12
local.get $this|12
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.2
end
i32.const 32
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 87
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#sub|inlined.0 (result i32)
global.get $std/pointer/two
local.set $this|13
global.get $std/pointer/one
local.set $other|14
local.get $this|13
local.get $other|14
i32.sub
br $std/pointer/Pointer<std/pointer/Entry>#sub|inlined.0
end
global.set $std/pointer/sub
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.3 (result i32)
global.get $std/pointer/sub
local.set $this|15
local.get $this|15
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.3
end
i32.const 16
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 90
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.4 (result i32)
global.get $std/pointer/one
local.set $this|16
local.get $this|16
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.4
end
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 92
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#inc|inlined.0 (result i32)
global.get $std/pointer/one
local.set $this|17
local.get $this|17
i32.const 8
i32.add
br $std/pointer/Pointer<std/pointer/Entry>#inc|inlined.0
end
global.set $std/pointer/one
global.get $std/pointer/one
global.set $std/pointer/nextOne
global.get $std/pointer/nextOne
global.get $std/pointer/one
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 94
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.5 (result i32)
global.get $std/pointer/one
local.set $this|18
local.get $this|18
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.5
end
i32.const 16
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 95
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.6 (result i32)
global.get $std/pointer/two
local.set $this|19
local.get $this|19
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.6
end
i32.const 24
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 97
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#dec|inlined.0 (result i32)
global.get $std/pointer/two
local.set $this|20
local.get $this|20
i32.const 8
i32.sub
br $std/pointer/Pointer<std/pointer/Entry>#dec|inlined.0
end
global.set $std/pointer/two
block $std/pointer/Pointer<std/pointer/Entry>#dec|inlined.1 (result i32)
global.get $std/pointer/two
local.set $this|21
local.get $this|21
i32.const 8
i32.sub
br $std/pointer/Pointer<std/pointer/Entry>#dec|inlined.1
end
global.set $std/pointer/two
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.7 (result i32)
global.get $std/pointer/two
local.set $this|22
local.get $this|22
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.7
end
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 100
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.4 (result i32)
global.get $std/pointer/two
local.set $this|23
i32.const 1
drop
local.get $this|23
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.4
end
call $std/pointer/Entry#get:key
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 101
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.5 (result i32)
global.get $std/pointer/two
local.set $this|24
i32.const 1
drop
local.get $this|24
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.5
end
call $std/pointer/Entry#get:val
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 102
i32.const 1
call $~lib/builtins/abort
unreachable
end
global.get $std/pointer/one
local.set $this|26
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.6 (result i32)
global.get $std/pointer/two
local.set $this|25
i32.const 1
drop
local.get $this|25
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.6
end
local.set $value
i32.const 1
drop
i32.const 0
drop
local.get $value
i32.const 0
i32.eq
if
local.get $this|26
i32.const 0
i32.const 8
memory.fill
else
local.get $this|26
local.get $value
i32.const 8
memory.copy
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.8 (result i32)
global.get $std/pointer/one
local.set $this|28
local.get $this|28
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.8
end
block $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.9 (result i32)
global.get $std/pointer/two
local.set $this|29
local.get $this|29
br $std/pointer/Pointer<std/pointer/Entry>#get:offset|inlined.9
end
i32.ne
i32.eqz
if
i32.const 0
i32.const 32
i32.const 105
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.7 (result i32)
global.get $std/pointer/one
local.set $this|30
i32.const 1
drop
local.get $this|30
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.7
end
call $std/pointer/Entry#get:key
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 106
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.8 (result i32)
global.get $std/pointer/one
local.set $this|31
i32.const 1
drop
local.get $this|31
br $std/pointer/Pointer<std/pointer/Entry>#get:value|inlined.8
end
call $std/pointer/Entry#get:val
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 107
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<f32>#constructor|inlined.0 (result i32)
i32.const 0
local.set $this|32
i32.const 0
local.set $offset|33
local.get $offset|33
br $std/pointer/Pointer<f32>#constructor|inlined.0
end
global.set $std/pointer/buf
global.get $std/pointer/buf
local.set $this|34
i32.const 0
local.set $index
f32.const 1.100000023841858
local.set $value|36
local.get $this|34
local.get $index
i32.const 4
i32.mul
i32.add
local.get $value|36
f32.store
global.get $std/pointer/buf
local.set $this|37
i32.const 1
local.set $index|38
f32.const 1.2000000476837158
local.set $value|39
local.get $this|37
local.get $index|38
i32.const 4
i32.mul
i32.add
local.get $value|39
f32.store
block $std/pointer/Pointer<f32>#get|inlined.0 (result f32)
global.get $std/pointer/buf
local.set $this|40
i32.const 0
local.set $index|41
local.get $this|40
local.get $index|41
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.0
end
f32.const 1.100000023841858
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 113
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<f32>#get|inlined.1 (result f32)
global.get $std/pointer/buf
local.set $this|42
i32.const 1
local.set $index|43
local.get $this|42
local.get $index|43
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.1
end
f32.const 1.2000000476837158
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 114
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<f32>#get|inlined.2 (result f32)
global.get $std/pointer/buf
local.set $this|44
i32.const 0
local.set $index|45
local.get $this|44
local.get $index|45
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.2
end
f32.const 1.100000023841858
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 116
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<f32>#get|inlined.3 (result f32)
global.get $std/pointer/buf
local.set $this|46
i32.const 1
local.set $index|47
local.get $this|46
local.get $index|47
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.3
end
f32.const 1.2000000476837158
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 117
i32.const 1
call $~lib/builtins/abort
unreachable
end
i32.const 0
f32.load
f32.const 1.100000023841858
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 119
i32.const 1
call $~lib/builtins/abort
unreachable
end
i32.const 4
f32.load
f32.const 1.2000000476837158
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 120
i32.const 1
call $~lib/builtins/abort
unreachable
end
global.get $std/pointer/buf
local.set $this|48
i32.const 2
local.set $index|49
f32.const 1.2999999523162842
local.set $value|50
local.get $this|48
local.get $index|49
i32.const 4
i32.mul
i32.add
local.get $value|50
f32.store
block $std/pointer/Pointer<f32>#get|inlined.4 (result f32)
global.get $std/pointer/buf
local.set $this|51
i32.const 2
local.set $index|52
local.get $this|51
local.get $index|52
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.4
end
f32.const 1.2999999523162842
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 123
i32.const 1
call $~lib/builtins/abort
unreachable
end
block $std/pointer/Pointer<f32>#get|inlined.5 (result f32)
global.get $std/pointer/buf
local.set $this|53
i32.const 2
local.set $index|54
local.get $this|53
local.get $index|54
i32.const 4
i32.mul
i32.add
f32.load
br $std/pointer/Pointer<f32>#get|inlined.5
end
f32.const 1.2999999523162842
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 124
i32.const 1
call $~lib/builtins/abort
unreachable
end
i32.const 8
f32.load
f32.const 1.2999999523162842
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 125
i32.const 1
call $~lib/builtins/abort
unreachable
end
global.get $std/pointer/buf
local.set $this|55
f32.const 1.399999976158142
local.set $value|56
i32.const 0
drop
local.get $this|55
local.get $value|56
f32.store
block $std/pointer/Pointer<f32>#get:value|inlined.0 (result f32)
global.get $std/pointer/buf
local.set $this|57
i32.const 0
drop
local.get $this|57
f32.load
br $std/pointer/Pointer<f32>#get:value|inlined.0
end
f32.const 1.399999976158142
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 128
i32.const 1
call $~lib/builtins/abort
unreachable
end
i32.const 0
f32.load
f32.const 1.399999976158142
f32.eq
i32.eqz
if
i32.const 0
i32.const 32
i32.const 129
i32.const 1
call $~lib/builtins/abort
unreachable
end
)
(func $~start
call $start:std/pointer
)
)