Commit da00140
committed
Fix optimized grouping of locals
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 cfa8abd commit da00140
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 | | |
| |||
3241 | 3239 | | |
3242 | 3240 | | |
3243 | 3241 | | |
3244 | | - | |
| 3242 | + | |
3245 | 3243 | | |
3246 | 3244 | | |
3247 | 3245 | | |
3248 | | - | |
| 3246 | + | |
3249 | 3247 | | |
3250 | 3248 | | |
3251 | 3249 | | |
| |||
3263 | 3261 | | |
3264 | 3262 | | |
3265 | 3263 | | |
3266 | | - | |
| 3264 | + | |
3267 | 3265 | | |
3268 | 3266 | | |
3269 | 3267 | | |
3270 | 3268 | | |
3271 | 3269 | | |
3272 | | - | |
3273 | | - | |
3274 | | - | |
3275 | | - | |
3276 | | - | |
3277 | | - | |
3278 | 3270 | | |
3279 | 3271 | | |
3280 | 3272 | | |
3281 | 3273 | | |
3282 | 3274 | | |
3283 | 3275 | | |
3284 | 3276 | | |
3285 | | - | |
3286 | | - | |
3287 | | - | |
3288 | | - | |
3289 | | - | |
3290 | | - | |
3291 | | - | |
3292 | | - | |
3293 | | - | |
3294 | | - | |
| 3277 | + | |
3295 | 3278 | | |
3296 | 3279 | | |
3297 | | - | |
| 3280 | + | |
3298 | 3281 | | |
3299 | | - | |
| 3282 | + | |
| 3283 | + | |
3300 | 3284 | | |
3301 | 3285 | | |
3302 | 3286 | | |
| |||
0 commit comments