RESOLVED FIXED227052
AssemblyHelpers should save/restore callee save FPRs
https://bugs.webkit.org/show_bug.cgi?id=227052
Summary AssemblyHelpers should save/restore callee save FPRs
Tadeu Zagallo
Reported 2021-06-15 16:14:38 PDT
Attachments
Patch (10.01 KB, patch)
2021-06-15 16:35 PDT, Tadeu Zagallo
no flags
Patch (8.85 KB, patch)
2021-06-15 16:55 PDT, Tadeu Zagallo
ews-feeder: commit-queue-
Patch (8.86 KB, patch)
2021-06-15 17:01 PDT, Tadeu Zagallo
no flags
Patch for landing (8.85 KB, patch)
2021-06-16 08:29 PDT, Tadeu Zagallo
no flags
Tadeu Zagallo
Comment 1 2021-06-15 16:35:42 PDT
Mark Lam
Comment 2 2021-06-15 16:46:08 PDT
Comment on attachment 431496 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431496&action=review > Source/JavaScriptCore/jit/AssemblyHelpers.h:344 > + if (entry.reg().isGPR()) > + storePtr(entry.reg().gpr(), Address(framePointerRegister, entry.offset())); > + else > + storeDouble(entry.reg().fpr(), Address(framePointerRegister, entry.offset())); You can just do: storeReg(entry.reg(), Address(framePointerRegister, entry.offset())); > Source/JavaScriptCore/jit/AssemblyHelpers.h:383 > + if (entry.reg().isGPR()) > + storePtr(entry.reg().gpr(), Address(framePointerRegister, offsetVirtualRegister.offsetInBytes() + entry.offset())); > + else > + storeDouble(entry.reg().fpr(), Address(framePointerRegister, offsetVirtualRegister.offsetInBytes() + entry.offset())); > + } Pretty sure this is not needed because this function is only ever called with a baseline CodeBlock. Please check if I'm wrong. If it is baseline CodeBlock only, then just RELEASE_ASSERT the Codeblock JITType at the top. > Source/JavaScriptCore/jit/AssemblyHelpers.h:407 > + if (entry.reg().isGPR()) > + loadPtr(Address(framePointerRegister, entry.offset()), entry.reg().gpr()); > + else > + loadDouble(Address(framePointerRegister, entry.offset()), entry.reg().fpr()); Just use loadReg(Address(framePointerRegister, entry.offset()), entry.reg());
Tadeu Zagallo
Comment 3 2021-06-15 16:55:58 PDT
Tadeu Zagallo
Comment 4 2021-06-15 17:01:32 PDT
Mark Lam
Comment 5 2021-06-15 17:09:00 PDT
Comment on attachment 431499 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431499&action=review r=me with ChangeLog fixes. > Source/JavaScriptCore/ChangeLog:9 > + We have 3 functions in AssemblyHelpers to save and restore callee save registers that were filtering 4 functions (according to this patch), not 3. > Source/JavaScriptCore/ChangeLog:10 > + out any FPRs. This is an issue since we do have callee save FPRs in arm64 and these helpers can be /these helpers can be/there are helpers/? Otherwise, it's not clear which helpers the "these helpers" refer to. > Source/JavaScriptCore/ChangeLog:11 > + called from the FTL, which uses those callee saves. The test case shows how that's an issue with tail remove the ',' to go with the above edit?
Tadeu Zagallo
Comment 6 2021-06-15 17:15:34 PDT
Comment on attachment 431499 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431499&action=review Thanks for the reviews, I'll reword the changelog. >> Source/JavaScriptCore/ChangeLog:9 >> + We have 3 functions in AssemblyHelpers to save and restore callee save registers that were filtering > > 4 functions (according to this patch), not 3. There are 3 functions in AssemblyHelpers and one in DFGOSREntry, which I mention below. >> Source/JavaScriptCore/ChangeLog:10 >> + out any FPRs. This is an issue since we do have callee save FPRs in arm64 and these helpers can be > > /these helpers can be/there are helpers/? Otherwise, it's not clear which helpers the "these helpers" refer to. I think the issue is because I edited the other part of the phrase, but forgot about this one. I meant to say "these functions", referring to the "3 functions" from the previous sentence.
Mark Lam
Comment 7 2021-06-15 17:20:37 PDT
Comment on attachment 431499 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431499&action=review >>> Source/JavaScriptCore/ChangeLog:9 >>> + We have 3 functions in AssemblyHelpers to save and restore callee save registers that were filtering >> >> 4 functions (according to this patch), not 3. > > There are 3 functions in AssemblyHelpers and one in DFGOSREntry, which I mention below. ok. >>> Source/JavaScriptCore/ChangeLog:10 >>> + out any FPRs. This is an issue since we do have callee save FPRs in arm64 and these helpers can be >> >> /these helpers can be/there are helpers/? Otherwise, it's not clear which helpers the "these helpers" refer to. > > I think the issue is because I edited the other part of the phrase, but forgot about this one. I meant to say "these functions", referring to the "3 functions" from the previous sentence. ok.
Tadeu Zagallo
Comment 8 2021-06-16 08:29:12 PDT
Created attachment 431549 [details] Patch for landing
EWS
Comment 9 2021-06-16 09:09:32 PDT
Committed r278937 (238868@main): <https://commits.webkit.org/238868@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431549 [details].
Note You need to log in before you can comment on or make changes to this bug.