|
1 | 1 | (module
|
| 2 | + (type $none_=>_none (func)) |
2 | 3 | (type $i32_=>_i32 (func (param i32) (result i32)))
|
3 |
| - (memory $0 0) |
| 4 | + (type $i32_=>_none (func (param i32))) |
| 5 | + (type $none_=>_i32 (func (result i32))) |
| 6 | + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) |
| 7 | + (memory $0 1) |
| 8 | + (data (i32.const 16) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") |
| 9 | + (data (i32.const 64) "&\00\00\00\01\00\00\00\01\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s") |
| 10 | + (global $~lib/rt/stub/startOffset (mut i32) (i32.const 0)) |
| 11 | + (global $~lib/rt/stub/offset (mut i32) (i32.const 0)) |
4 | 12 | (export "memory" (memory $0))
|
5 | 13 | (export "test" (func $class/test))
|
| 14 | + (export "testGenericInitializer" (func $class/testGenericInitializer)) |
| 15 | + (start $~start) |
6 | 16 | (func $class/test (; 0 ;) (param $0 i32) (result i32)
|
7 | 17 | local.get $0
|
8 | 18 | i32.load
|
|
24 | 34 | i32.store8 offset=6
|
25 | 35 | local.get $0
|
26 | 36 | )
|
| 37 | + (func $~lib/rt/stub/maybeGrowMemory (; 1 ;) (param $0 i32) |
| 38 | + (local $1 i32) |
| 39 | + (local $2 i32) |
| 40 | + local.get $0 |
| 41 | + memory.size |
| 42 | + local.tee $2 |
| 43 | + i32.const 16 |
| 44 | + i32.shl |
| 45 | + local.tee $1 |
| 46 | + i32.gt_u |
| 47 | + if |
| 48 | + local.get $2 |
| 49 | + local.get $0 |
| 50 | + local.get $1 |
| 51 | + i32.sub |
| 52 | + i32.const 65535 |
| 53 | + i32.add |
| 54 | + i32.const -65536 |
| 55 | + i32.and |
| 56 | + i32.const 16 |
| 57 | + i32.shr_u |
| 58 | + local.tee $1 |
| 59 | + local.get $2 |
| 60 | + local.get $1 |
| 61 | + i32.gt_s |
| 62 | + select |
| 63 | + memory.grow |
| 64 | + i32.const 0 |
| 65 | + i32.lt_s |
| 66 | + if |
| 67 | + local.get $1 |
| 68 | + memory.grow |
| 69 | + i32.const 0 |
| 70 | + i32.lt_s |
| 71 | + if |
| 72 | + unreachable |
| 73 | + end |
| 74 | + end |
| 75 | + end |
| 76 | + local.get $0 |
| 77 | + global.set $~lib/rt/stub/offset |
| 78 | + ) |
| 79 | + (func $~lib/rt/stub/__alloc (; 2 ;) (param $0 i32) (param $1 i32) (result i32) |
| 80 | + (local $2 i32) |
| 81 | + (local $3 i32) |
| 82 | + (local $4 i32) |
| 83 | + local.get $0 |
| 84 | + i32.const 1073741808 |
| 85 | + i32.gt_u |
| 86 | + if |
| 87 | + unreachable |
| 88 | + end |
| 89 | + global.get $~lib/rt/stub/offset |
| 90 | + i32.const 16 |
| 91 | + i32.add |
| 92 | + local.tee $3 |
| 93 | + local.get $0 |
| 94 | + i32.const 15 |
| 95 | + i32.add |
| 96 | + i32.const -16 |
| 97 | + i32.and |
| 98 | + local.tee $2 |
| 99 | + i32.const 16 |
| 100 | + local.get $2 |
| 101 | + i32.const 16 |
| 102 | + i32.gt_u |
| 103 | + select |
| 104 | + local.tee $4 |
| 105 | + i32.add |
| 106 | + call $~lib/rt/stub/maybeGrowMemory |
| 107 | + local.get $3 |
| 108 | + i32.const 16 |
| 109 | + i32.sub |
| 110 | + local.tee $2 |
| 111 | + local.get $4 |
| 112 | + i32.store |
| 113 | + local.get $2 |
| 114 | + i32.const 1 |
| 115 | + i32.store offset=4 |
| 116 | + local.get $2 |
| 117 | + local.get $1 |
| 118 | + i32.store offset=8 |
| 119 | + local.get $2 |
| 120 | + local.get $0 |
| 121 | + i32.store offset=12 |
| 122 | + local.get $3 |
| 123 | + ) |
| 124 | + (func $~lib/arraybuffer/ArrayBufferView#constructor (; 3 ;) (param $0 i32) (result i32) |
| 125 | + (local $1 i32) |
| 126 | + i32.const 0 |
| 127 | + i32.const 0 |
| 128 | + call $~lib/rt/stub/__alloc |
| 129 | + local.set $1 |
| 130 | + local.get $0 |
| 131 | + i32.eqz |
| 132 | + if |
| 133 | + i32.const 12 |
| 134 | + i32.const 2 |
| 135 | + call $~lib/rt/stub/__alloc |
| 136 | + local.set $0 |
| 137 | + end |
| 138 | + local.get $0 |
| 139 | + i32.const 0 |
| 140 | + i32.store |
| 141 | + local.get $0 |
| 142 | + i32.const 0 |
| 143 | + i32.store offset=4 |
| 144 | + local.get $0 |
| 145 | + i32.const 0 |
| 146 | + i32.store offset=8 |
| 147 | + local.get $0 |
| 148 | + i32.load |
| 149 | + drop |
| 150 | + local.get $0 |
| 151 | + local.get $1 |
| 152 | + i32.store |
| 153 | + local.get $0 |
| 154 | + local.get $1 |
| 155 | + i32.store offset=4 |
| 156 | + local.get $0 |
| 157 | + i32.const 0 |
| 158 | + i32.store offset=8 |
| 159 | + local.get $0 |
| 160 | + ) |
| 161 | + (func $class/GenericInitializer<i32>#constructor (; 4 ;) (result i32) |
| 162 | + (local $0 i32) |
| 163 | + (local $1 i32) |
| 164 | + i32.const 4 |
| 165 | + i32.const 4 |
| 166 | + call $~lib/rt/stub/__alloc |
| 167 | + local.set $0 |
| 168 | + i32.const 16 |
| 169 | + i32.const 5 |
| 170 | + call $~lib/rt/stub/__alloc |
| 171 | + call $~lib/arraybuffer/ArrayBufferView#constructor |
| 172 | + local.tee $1 |
| 173 | + i32.const 0 |
| 174 | + i32.store offset=12 |
| 175 | + local.get $1 |
| 176 | + i32.const 0 |
| 177 | + i32.store offset=12 |
| 178 | + local.get $0 |
| 179 | + local.get $1 |
| 180 | + i32.store |
| 181 | + local.get $0 |
| 182 | + ) |
| 183 | + (func $class/testGenericInitializer (; 5 ;) |
| 184 | + call $class/GenericInitializer<i32>#constructor |
| 185 | + drop |
| 186 | + ) |
| 187 | + (func $~start (; 6 ;) |
| 188 | + i32.const 128 |
| 189 | + global.set $~lib/rt/stub/startOffset |
| 190 | + i32.const 128 |
| 191 | + global.set $~lib/rt/stub/offset |
| 192 | + ) |
27 | 193 | )
|
0 commit comments