|
17 | 17 | (export "bench" (func $assembly/index/bench))
|
18 | 18 | (export "getBody" (func $assembly/index/getBody))
|
19 | 19 | (start $start)
|
20 |
| - (func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) |
| 20 | + (func $~lib/rt/stub/maybeGrowMemory (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) |
| 21 | + (local $1 i32) |
21 | 22 | (local $2 i32)
|
22 |
| - (local $3 i32) |
23 |
| - (local $4 i32) |
24 |
| - (local $5 i32) |
25 |
| - local.get $0 |
26 |
| - i32.const 1073741808 |
27 |
| - i32.gt_u |
28 |
| - if |
29 |
| - unreachable |
30 |
| - end |
31 |
| - global.get $~lib/rt/stub/offset |
32 |
| - i32.const 16 |
33 |
| - i32.add |
34 |
| - local.tee $3 |
35 | 23 | local.get $0
|
36 |
| - i32.const 1 |
37 |
| - local.get $0 |
38 |
| - i32.const 1 |
39 |
| - i32.gt_u |
40 |
| - select |
41 |
| - i32.add |
42 |
| - i32.const 15 |
43 |
| - i32.add |
44 |
| - i32.const -16 |
45 |
| - i32.and |
46 |
| - local.tee $2 |
47 | 24 | memory.size
|
48 |
| - local.tee $4 |
| 25 | + local.tee $2 |
49 | 26 | i32.const 16
|
50 | 27 | i32.shl
|
| 28 | + local.tee $1 |
51 | 29 | i32.gt_u
|
52 | 30 | if
|
53 |
| - local.get $4 |
54 | 31 | local.get $2
|
55 |
| - local.get $3 |
| 32 | + local.get $0 |
| 33 | + local.get $1 |
56 | 34 | i32.sub
|
57 | 35 | i32.const 65535
|
58 | 36 | i32.add
|
59 | 37 | i32.const -65536
|
60 | 38 | i32.and
|
61 | 39 | i32.const 16
|
62 | 40 | i32.shr_u
|
63 |
| - local.tee $5 |
64 |
| - local.get $4 |
65 |
| - local.get $5 |
| 41 | + local.tee $1 |
| 42 | + local.get $2 |
| 43 | + local.get $1 |
66 | 44 | i32.gt_s
|
67 | 45 | select
|
68 | 46 | memory.grow
|
69 | 47 | i32.const 0
|
70 | 48 | i32.lt_s
|
71 | 49 | if
|
72 |
| - local.get $5 |
| 50 | + local.get $1 |
73 | 51 | memory.grow
|
74 | 52 | i32.const 0
|
75 | 53 | i32.lt_s
|
|
78 | 56 | end
|
79 | 57 | end
|
80 | 58 | end
|
81 |
| - local.get $2 |
| 59 | + local.get $0 |
82 | 60 | global.set $~lib/rt/stub/offset
|
| 61 | + ) |
| 62 | + (func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) |
| 63 | + (local $2 i32) |
| 64 | + (local $3 i32) |
| 65 | + (local $4 i32) |
| 66 | + local.get $0 |
| 67 | + i32.const 1073741808 |
| 68 | + i32.gt_u |
| 69 | + if |
| 70 | + unreachable |
| 71 | + end |
| 72 | + global.get $~lib/rt/stub/offset |
| 73 | + i32.const 16 |
| 74 | + i32.add |
| 75 | + local.tee $3 |
| 76 | + local.get $0 |
| 77 | + i32.const 15 |
| 78 | + i32.add |
| 79 | + i32.const -16 |
| 80 | + i32.and |
| 81 | + local.tee $2 |
| 82 | + i32.const 16 |
| 83 | + local.get $2 |
| 84 | + i32.const 16 |
| 85 | + i32.gt_u |
| 86 | + select |
| 87 | + local.tee $4 |
| 88 | + i32.add |
| 89 | + call $~lib/rt/stub/maybeGrowMemory |
83 | 90 | local.get $3
|
84 | 91 | i32.const 16
|
85 | 92 | i32.sub
|
86 | 93 | local.tee $2
|
| 94 | + local.get $4 |
| 95 | + i32.store |
| 96 | + local.get $2 |
| 97 | + i32.const -1 |
| 98 | + i32.store offset=4 |
| 99 | + local.get $2 |
87 | 100 | local.get $1
|
88 | 101 | i32.store offset=8
|
89 | 102 | local.get $2
|
90 | 103 | local.get $0
|
91 | 104 | i32.store offset=12
|
92 | 105 | local.get $3
|
93 | 106 | )
|
94 |
| - (func $assembly/index/NBodySystem#constructor (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) |
| 107 | + (func $assembly/index/NBodySystem#constructor (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) |
95 | 108 | (local $1 i32)
|
96 | 109 | (local $2 i32)
|
97 | 110 | (local $3 f64)
|
|
174 | 187 | i32.store
|
175 | 188 | local.get $1
|
176 | 189 | )
|
177 |
| - (func $assembly/index/Body#constructor (; 2 ;) (type $FUNCSIG$iddddddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (result i32) |
| 190 | + (func $assembly/index/Body#constructor (; 3 ;) (type $FUNCSIG$iddddddd) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (result i32) |
178 | 191 | (local $7 i32)
|
179 | 192 | i32.const 56
|
180 | 193 | i32.const 4
|
|
202 | 215 | f64.store offset=48
|
203 | 216 | local.get $7
|
204 | 217 | )
|
205 |
| - (func $~lib/rt/__allocArray (; 3 ;) (type $FUNCSIG$i) (result i32) |
| 218 | + (func $~lib/rt/__allocArray (; 4 ;) (type $FUNCSIG$i) (result i32) |
206 | 219 | (local $0 i32)
|
207 | 220 | (local $1 i32)
|
208 | 221 | i32.const 16
|
|
225 | 238 | i32.store offset=12
|
226 | 239 | local.get $0
|
227 | 240 | )
|
228 |
| - (func $assembly/index/init (; 4 ;) (type $FUNCSIG$v) |
| 241 | + (func $assembly/index/init (; 5 ;) (type $FUNCSIG$v) |
229 | 242 | (local $0 i32)
|
230 | 243 | (local $1 i32)
|
231 | 244 | call $~lib/rt/__allocArray
|
|
285 | 298 | call $assembly/index/NBodySystem#constructor
|
286 | 299 | global.set $assembly/index/system
|
287 | 300 | )
|
288 |
| - (func $assembly/index/NBodySystem#advance (; 5 ;) (type $FUNCSIG$vi) (param $0 i32) |
| 301 | + (func $assembly/index/NBodySystem#advance (; 6 ;) (type $FUNCSIG$vi) (param $0 i32) |
289 | 302 | (local $1 i32)
|
290 | 303 | (local $2 f64)
|
291 | 304 | (local $3 i32)
|
|
485 | 498 | end
|
486 | 499 | end
|
487 | 500 | )
|
488 |
| - (func $assembly/index/NBodySystem#energy (; 6 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) |
| 501 | + (func $assembly/index/NBodySystem#energy (; 7 ;) (type $FUNCSIG$di) (param $0 i32) (result f64) |
489 | 502 | (local $1 f64)
|
490 | 503 | (local $2 i32)
|
491 | 504 | (local $3 i32)
|
|
613 | 626 | end
|
614 | 627 | local.get $1
|
615 | 628 | )
|
616 |
| - (func $assembly/index/step (; 7 ;) (type $FUNCSIG$d) (result f64) |
| 629 | + (func $assembly/index/step (; 8 ;) (type $FUNCSIG$d) (result f64) |
617 | 630 | global.get $assembly/index/system
|
618 | 631 | call $assembly/index/NBodySystem#advance
|
619 | 632 | global.get $assembly/index/system
|
620 | 633 | call $assembly/index/NBodySystem#energy
|
621 | 634 | )
|
622 |
| - (func $assembly/index/bench (; 8 ;) (type $FUNCSIG$vi) (param $0 i32) |
| 635 | + (func $assembly/index/bench (; 9 ;) (type $FUNCSIG$vi) (param $0 i32) |
623 | 636 | (local $1 i32)
|
624 | 637 | block $break|0
|
625 | 638 | loop $loop|0
|
|
638 | 651 | unreachable
|
639 | 652 | end
|
640 | 653 | )
|
641 |
| - (func $assembly/index/getBody (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) |
| 654 | + (func $assembly/index/getBody (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) |
642 | 655 | (local $1 i32)
|
643 | 656 | local.get $0
|
644 | 657 | global.get $assembly/index/system
|
|
654 | 667 | i32.shl
|
655 | 668 | i32.add
|
656 | 669 | i32.load
|
657 |
| - else |
| 670 | + else |
658 | 671 | i32.const 0
|
659 | 672 | end
|
660 | 673 | )
|
661 |
| - (func $start (; 10 ;) (type $FUNCSIG$v) |
| 674 | + (func $start (; 11 ;) (type $FUNCSIG$v) |
662 | 675 | i32.const 16
|
663 | 676 | global.set $~lib/rt/stub/startOffset
|
664 |
| - global.get $~lib/rt/stub/startOffset |
| 677 | + i32.const 16 |
665 | 678 | global.set $~lib/rt/stub/offset
|
666 | 679 | )
|
667 |
| - (func $null (; 11 ;) (type $FUNCSIG$v) |
| 680 | + (func $null (; 12 ;) (type $FUNCSIG$v) |
668 | 681 | nop
|
669 | 682 | )
|
670 | 683 | )
|
0 commit comments