Commit 951bc70
authored
Move assert checking the size of structs with GC pointers. (#34053)
Codegen for CpObj assumes that we cannot have a struct with GC pointers
whose size is not a multiple of the register size. We had an assert that
verified that in `ClassLayout::InitializeGCPtrs`.
The assert fired in the new pipeline that tests off-by-default features
in the leg that turns on object stack allocation. Stack-allocated
objects are never copied so the assert shouldn't apply to them.
I moved the assert to `Compiler::gtNewCpObjNode`. I clarified the
comment for the assert and changed it from `noway_assert` to a
regular `assert` since recompilation with minopts will not help if we
hit the assert.
I also added a repro case to ObjectStackAllocationTests that run with
COMPlus_JitObjectStackAllocation=1 in regular test runs.1 parent 1926a3c commit 951bc70
File tree
3 files changed
+34
-9
lines changed- src/coreclr
- src/jit
- tests/src/JIT/opt/ObjectStackAllocation
3 files changed
+34
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6579 | 6579 | | |
6580 | 6580 | | |
6581 | 6581 | | |
6582 | | - | |
| 6582 | + | |
| 6583 | + | |
| 6584 | + | |
| 6585 | + | |
| 6586 | + | |
| 6587 | + | |
| 6588 | + | |
| 6589 | + | |
| 6590 | + | |
| 6591 | + | |
| 6592 | + | |
| 6593 | + | |
| 6594 | + | |
6583 | 6595 | | |
6584 | 6596 | | |
6585 | 6597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 376 | | |
383 | 377 | | |
384 | 378 | | |
| |||
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
46 | 58 | | |
47 | 59 | | |
48 | 60 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
| 152 | + | |
| 153 | + | |
140 | 154 | | |
141 | 155 | | |
142 | 156 | | |
| |||
170 | 184 | | |
171 | 185 | | |
172 | 186 | | |
173 | | - | |
174 | | - | |
175 | 187 | | |
176 | 188 | | |
177 | 189 | | |
| |||
326 | 338 | | |
327 | 339 | | |
328 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
329 | 348 | | |
330 | 349 | | |
0 commit comments