|
| 1 | +2020-09-24 Angelos Oikonomopoulos < [email protected]> |
| 2 | + |
| 3 | + [MIPS] Broken build after r267371 |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=216893 |
| 5 | + |
| 6 | + Reviewed by Adrian Perez de Castro. |
| 7 | + |
| 8 | + This addresses two issues. |
| 9 | + |
| 10 | + First, the fix in https://bugs.webkit.org/show_bug.cgi?id=216772 was not |
| 11 | + getting exercised, because the LabelReference offset was always zero. |
| 12 | + |
| 13 | + The reason the offset was zero is that LabelReference.mapChildren would discard |
| 14 | + the offset when generating a new LabelReference to wrap the Label returned by |
| 15 | + the code block it yielded to. |
| 16 | + |
| 17 | + The reason this was only an issue on MIPS is because only MIPS was using the |
| 18 | + result of calls to LabelReference.mapChildren (in its lowering phase, |
| 19 | + assignRegistersToTemporaries -> replaceTemporariesWithRegisters -> |
| 20 | + mapChildren). Other archs, e.g. X86_64 only call mapChildren in earlier phases |
| 21 | + (specifically, subsequent to a call to isASTErroneous), in which the new |
| 22 | + LabelReferences returned by mapChildren are later discarded. Even though ARM |
| 23 | + 32/64 contains indirect calls to mapChildren, those are made after the |
| 24 | + arm{,64}LowerLabelReferences transformation which doesn't leave any |
| 25 | + LabelReference nodes around for .mapChildren to be called on. |
| 26 | + |
| 27 | + So this is not an issue for architectures other than MIPS because |
| 28 | + (a) AddImmediates.fold correctly constructs a LabelReference with an offset by |
| 29 | + calling LabelReference.plusOffset and |
| 30 | + (b) they don't call (and therefore don't use the result of) |
| 31 | + LabelReference.mapChildren in their lowering code. |
| 32 | + |
| 33 | + Second, the code we generate needs to look up the /label/ in the GOT, not the |
| 34 | + computed address. After the lookup, we simply need to add the offset. |
| 35 | + |
| 36 | + * offlineasm/ast.rb: |
| 37 | + * offlineasm/mips.rb: |
| 38 | + |
1 | 39 | 2020-09-24 Ross Kirsling < [email protected]>
|
2 | 40 |
|
3 | 41 | %TypedArray%.prototype.fill must only evaluate its argument once
|
|
0 commit comments