Commit fc3e8ea
[clr-ios] Fix Vector<T> width and R2R AVX baseline mismatch on x64 iOS/tvOS simulators (#129012)
## Description
The interpreter only supports 128-bit Vector<T>, but on Mac Catalyst and
iOS simulator x64 it was ending up with 256-bit Vector<T>, which is what
caused the NullReferenceException in Vector.get_IsHardwareAccelerated.
The runtime already limits Vector<T> to 128-bit for the full interpreter
mode, but it wasn't doing so on no-JIT builds where everything is
interpreted anyway, so AVX2 on x64 silently bumped it up to 256-bit.
This change applies the same 128-bit limit whenever the interpreter is
the only thing running code. arm64 was never affected since Vector<T> is
always 128-bit there.
Crossgen2 had the matching problem where it presumed an x86-64-v3 (AVX2)
ReadyToRun baseline for the Apple x64 simulator targets, so the
precompiled R2R code and the interpreter disagreed on the Vector<T>
width. It now uses the x86-64-v2 baseline for the iOS/tvOS simulators as
well, matching osx and maccatalyst, so both share the same 128-bit view.
The x64 simulators also run under Rosetta, which does not support AVX,
so presuming it was incorrect regardless.
As defense in depth, when an eager fixup failure disables R2R on a
no-JIT runtime where the image was compiled with stripped IL bodies (so
there is no IL to fall back to), the runtime now fails fast with a clear
message instead of running the throw stub left in place of the IL, which
previously surfaced as an opaque stack overflow.
Fixes #128901
Fixes #128898
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e099ef5 commit fc3e8ea
4 files changed
Lines changed: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3588 | 3588 | | |
3589 | 3589 | | |
3590 | 3590 | | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
3591 | 3599 | | |
3592 | 3600 | | |
3593 | 3601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1507 | 1512 | | |
1508 | 1513 | | |
1509 | 1514 | | |
| |||
1873 | 1878 | | |
1874 | 1879 | | |
1875 | 1880 | | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
1883 | | - | |
1884 | 1881 | | |
1885 | 1882 | | |
1886 | 1883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
252 | 258 | | |
253 | 259 | | |
254 | 260 | | |
| |||
0 commit comments