Commit 71df7db
authored
JIT: Eagerly invalidate GC state for registers trashed by linker relaxation sequences (#128073)
TLS accesses are optimized in NativeAOT with the help of the linker. The
JIT emits a sequence of instructions that is specially recognized, and
the linker then rewrites (relaxes) those instructions to a more
efficient pattern.
Normally, when the JIT emits instructions, it only lazily updates GC
state. For example, if `rax` contains a GC reference, we delay any
actual GC information update until we actually emit an instruction that
clobbers `rax`. This is regardless of whether or not the value in `rax`
died a long time ago.
This is a problem for these linker relaxation sequences. The linker's
instructions may end up clobbering registers earlier than we do in our
emitted instructions, and in that case we are reporting a GC register as
live while it had been trashed.
Fix the case for linux-x64 and linux-arm64 by eagerly emitting GC state
updates for these special patterns.1 parent ab8649f commit 71df7db
4 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3353 | 3353 | | |
3354 | 3354 | | |
3355 | 3355 | | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
3356 | 3364 | | |
3357 | 3365 | | |
3358 | 3366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
487 | 496 | | |
488 | 497 | | |
489 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11749 | 11749 | | |
11750 | 11750 | | |
11751 | 11751 | | |
| 11752 | + | |
| 11753 | + | |
| 11754 | + | |
| 11755 | + | |
| 11756 | + | |
| 11757 | + | |
| 11758 | + | |
| 11759 | + | |
| 11760 | + | |
| 11761 | + | |
| 11762 | + | |
11752 | 11763 | | |
11753 | 11764 | | |
11754 | 11765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18451 | 18451 | | |
18452 | 18452 | | |
18453 | 18453 | | |
| 18454 | + | |
| 18455 | + | |
| 18456 | + | |
| 18457 | + | |
| 18458 | + | |
| 18459 | + | |
| 18460 | + | |
18454 | 18461 | | |
18455 | 18462 | | |
18456 | 18463 | | |
| |||
0 commit comments