Bug 270971
| Summary: | Unpredictable temporary selection in offlineasm | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Max Rottenkolber <maximilian> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | justin_michaud, keith_miller, mark.lam, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Max Rottenkolber
assignRegistersToTemporaries reverses its freeRegisters stack in each iteration,
leading to somewhat unpredictable assignment of scratch registers.
This goes against the inline documentation for scratch register allocation:
# These are allocated from the end. Use the low order r6 first, ast it's often
# cheaper to encode. r12 and r9 are equivalent, but r9 conflicts with t7, so r9
# only as last resort.
So for example the following unstable expansions occur (on armv7):
leap (x), t7 -> globaladdr x, r9, r12
leap (x), t7 -> globaladdr x, r9, r9
leap (x), t7 -> globaladdr x, r9, r12
We should maintain the freeRegisters stack order across iterations to ensure
temp/scratch priority is respected.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Lam
FWIW, the "inline documentation" that Max quoted is specific to 32-bit arm i.e. armv7 only.
Radar WebKit Bug Importer
<rdar://problem/125161316>
EWS
Committed 278856@main (4a07711b9554): <https://commits.webkit.org/278856@main>
Reviewed commits have been landed. Closing PR #25882 and removing active labels.