|
| 1 | +(module |
| 2 | + (type $FUNCSIG$iii (func (param i32 i32) (result i32))) |
| 3 | + (type $FUNCSIG$vi (func (param i32))) |
| 4 | + (type $FUNCSIG$ii (func (param i32) (result i32))) |
| 5 | + (type $FUNCSIG$i (func (result i32))) |
| 6 | + (type $FUNCSIG$v (func)) |
| 7 | + (memory $0 0) |
| 8 | + (global $generic-export/okVariable i32 (i32.const 1)) |
| 9 | + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) |
| 10 | + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) |
| 11 | + (global $generic-export/OkClass i32 (i32.const 4)) |
| 12 | + (export "memory" (memory $0)) |
| 13 | + (export "genericExample<i32>" (func $generic-export/okFunction)) |
| 14 | + (export "okFunction" (func $generic-export/okFunction)) |
| 15 | + (export "OkClass" (global $generic-export/OkClass)) |
| 16 | + (export "OkClass#one" (func $generic-export/OkClass#one)) |
| 17 | + (export "okVariable" (global $generic-export/okVariable)) |
| 18 | + (export "functionThatUsesGenericFunction" (func $generic-export/functionThatUsesGenericFunction)) |
| 19 | + (start $start) |
| 20 | + (func $~lib/rt/stub/maybeGrowMemory (; 0 ;) (type $FUNCSIG$vi) (param $0 i32) |
| 21 | + (local $1 i32) |
| 22 | + (local $2 i32) |
| 23 | + local.get $0 |
| 24 | + memory.size |
| 25 | + local.tee $2 |
| 26 | + i32.const 16 |
| 27 | + i32.shl |
| 28 | + local.tee $1 |
| 29 | + i32.gt_u |
| 30 | + if |
| 31 | + local.get $2 |
| 32 | + local.get $0 |
| 33 | + local.get $1 |
| 34 | + i32.sub |
| 35 | + i32.const 65535 |
| 36 | + i32.add |
| 37 | + i32.const -65536 |
| 38 | + i32.and |
| 39 | + i32.const 16 |
| 40 | + i32.shr_u |
| 41 | + local.tee $1 |
| 42 | + local.get $2 |
| 43 | + local.get $1 |
| 44 | + i32.gt_s |
| 45 | + select |
| 46 | + memory.grow |
| 47 | + i32.const 0 |
| 48 | + i32.lt_s |
| 49 | + if |
| 50 | + local.get $1 |
| 51 | + memory.grow |
| 52 | + i32.const 0 |
| 53 | + i32.lt_s |
| 54 | + if |
| 55 | + unreachable |
| 56 | + end |
| 57 | + end |
| 58 | + end |
| 59 | + local.get $0 |
| 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 |
| 90 | + local.get $3 |
| 91 | + i32.const 16 |
| 92 | + i32.sub |
| 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 |
| 100 | + local.get $1 |
| 101 | + i32.store offset=8 |
| 102 | + local.get $2 |
| 103 | + local.get $0 |
| 104 | + i32.store offset=12 |
| 105 | + local.get $3 |
| 106 | + ) |
| 107 | + (func $~lib/rt/__allocArray (; 2 ;) (type $FUNCSIG$i) (result i32) |
| 108 | + (local $0 i32) |
| 109 | + (local $1 i32) |
| 110 | + i32.const 16 |
| 111 | + i32.const 3 |
| 112 | + call $~lib/rt/stub/__alloc |
| 113 | + local.tee $0 |
| 114 | + i32.const 8 |
| 115 | + i32.const 0 |
| 116 | + call $~lib/rt/stub/__alloc |
| 117 | + local.tee $1 |
| 118 | + i32.store |
| 119 | + local.get $0 |
| 120 | + local.get $1 |
| 121 | + i32.store offset=4 |
| 122 | + local.get $0 |
| 123 | + i32.const 8 |
| 124 | + i32.store offset=8 |
| 125 | + local.get $0 |
| 126 | + i32.const 2 |
| 127 | + i32.store offset=12 |
| 128 | + local.get $0 |
| 129 | + ) |
| 130 | + (func $generic-export/okFunction (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32) |
| 131 | + (local $2 i32) |
| 132 | + (local $3 i32) |
| 133 | + call $~lib/rt/__allocArray |
| 134 | + local.tee $2 |
| 135 | + i32.load offset=4 |
| 136 | + local.tee $3 |
| 137 | + local.get $0 |
| 138 | + i32.store |
| 139 | + local.get $3 |
| 140 | + local.get $1 |
| 141 | + i32.store offset=4 |
| 142 | + local.get $2 |
| 143 | + ) |
| 144 | + (func $generic-export/OkClass#one (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32) |
| 145 | + i32.const 1 |
| 146 | + ) |
| 147 | + (func $generic-export/functionThatUsesGenericFunction (; 5 ;) (type $FUNCSIG$i) (result i32) |
| 148 | + i32.const 1 |
| 149 | + i32.const 1 |
| 150 | + call $generic-export/okFunction |
| 151 | + ) |
| 152 | + (func $start (; 6 ;) (type $FUNCSIG$v) |
| 153 | + i32.const 16 |
| 154 | + global.set $~lib/rt/stub/startOffset |
| 155 | + i32.const 16 |
| 156 | + global.set $~lib/rt/stub/offset |
| 157 | + ) |
| 158 | + (func $null (; 7 ;) (type $FUNCSIG$v) |
| 159 | + nop |
| 160 | + ) |
| 161 | +) |
0 commit comments