Commit a6f85e5
authored
Fix optimized grouping of locals (#8577)
In #8568 we optimized the grouping of locals in the binary writer to
account for how types will be written given the enabled features.
However, that change did not properly update the handling of scratch
locals accordingly, leading to inconsistencies in the indices assigned
to local types in different locations. Fix the problem by reverting the
changes from #8568 and handling the mapping from IR types to written
types at a lower level; specifically, create a new `TypeIndexMap` type
that extends `InsertOrderedMap` but always applies
`asWrittenGivenFeatures` to its keys. Use this new map type both for the
`numLocalsByType` map and the `scratchLocals` map.1 parent 27dbce1 commit a6f85e5
2 files changed
+39
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 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 | + | |
147 | 175 | | |
148 | 176 | | |
149 | 177 | | |
150 | | - | |
| 178 | + | |
151 | 179 | | |
152 | 180 | | |
153 | | - | |
154 | 181 | | |
155 | 182 | | |
156 | 183 | | |
157 | 184 | | |
158 | | - | |
| 185 | + | |
159 | 186 | | |
160 | | - | |
| 187 | + | |
161 | 188 | | |
162 | 189 | | |
163 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
3245 | 3243 | | |
3246 | 3244 | | |
3247 | 3245 | | |
3248 | | - | |
| 3246 | + | |
3249 | 3247 | | |
3250 | 3248 | | |
3251 | 3249 | | |
3252 | | - | |
| 3250 | + | |
3253 | 3251 | | |
3254 | 3252 | | |
3255 | 3253 | | |
| |||
3267 | 3265 | | |
3268 | 3266 | | |
3269 | 3267 | | |
3270 | | - | |
| 3268 | + | |
3271 | 3269 | | |
3272 | 3270 | | |
3273 | 3271 | | |
3274 | 3272 | | |
3275 | 3273 | | |
3276 | | - | |
3277 | | - | |
3278 | | - | |
3279 | | - | |
3280 | | - | |
3281 | | - | |
3282 | 3274 | | |
3283 | 3275 | | |
3284 | 3276 | | |
3285 | 3277 | | |
3286 | 3278 | | |
3287 | 3279 | | |
3288 | 3280 | | |
3289 | | - | |
3290 | | - | |
3291 | | - | |
3292 | | - | |
3293 | | - | |
3294 | | - | |
3295 | | - | |
3296 | | - | |
3297 | | - | |
3298 | | - | |
| 3281 | + | |
3299 | 3282 | | |
3300 | 3283 | | |
3301 | | - | |
| 3284 | + | |
3302 | 3285 | | |
3303 | | - | |
| 3286 | + | |
| 3287 | + | |
3304 | 3288 | | |
3305 | 3289 | | |
3306 | 3290 | | |
| |||
0 commit comments