Bug 239578

Summary: [JSC] Remove TempRegisterSet
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, commit-queue, ews-watchlist, gyuyoung.kim, keith_miller, mark.lam, msaboff, ryuan.choi, saam, sergio, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 239613    
Bug Blocks:    
Attachments:
Description Flags
Patch mark.lam: review+

Yusuke Suzuki
Reported 2022-04-20 17:24:22 PDT
[JSC] Remove TempRegisterSet
Attachments
Patch (31.28 KB, patch)
2022-04-21 14:55 PDT, Yusuke Suzuki
mark.lam: review+
Yusuke Suzuki
Comment 1 2022-04-20 17:27:27 PDT
EWS
Comment 2 2022-04-20 22:29:18 PDT
Committed r293146 (249842@main): <https://commits.webkit.org/249842@main> Reviewed commits have been landed. Closing PR #337 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2022-04-20 22:30:14 PDT
WebKit Commit Bot
Comment 4 2022-04-21 10:30:58 PDT
Re-opened since this is blocked by bug 239613
Yusuke Suzuki
Comment 5 2022-04-21 14:55:32 PDT
Mark Lam
Comment 6 2022-04-21 15:15:03 PDT
Comment on attachment 458095 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458095&action=review r=me > Source/JavaScriptCore/ChangeLog:10 > + We can always use RegisterSet. TempRegisterSet can save several bytes, but we have no code using TempRegisterSet in > + heap-allocated class, so this does not make sense anymore. Instead of TempRegisterSet, we should consistently use > + ScratchRegisterAllocator. I suggest slightly rephrasing this as follows: We can always use RegisterSet. TempRegisterSet can save several bytes, but we have no code using TempRegisterSet in heap-allocated classes. So, this does not make sense anymore. Instead of TempRegisterSet, we will consistently use RegisterSet to pass register info and ScratchRegisterAllocator to manage allocation of temp / scratch registers. > Source/JavaScriptCore/ChangeLog:14 > + We also remove copyCalleeSavesToEntryFrameCalleeSavesBuffer function with no scratch register. We were using TempRegisterSet > + to allocate scratch register, but the caller of this function has particular assumption on how register is allocated from > + TempRegisterSet. This is very fragile and dangerous. We should pass scratch register explicitly in that case. We also remove the copyCalleeSavesToEntryFrameCalleeSavesBuffer function which takes no scratch register. It was using TempRegisterSet to allocate a scratch register, but the caller of this function was making assumptions on how TempRegisterSet will allocate that scratch. This is very fragile and dangerous. We should explicitly pass a scratch register instead in that case.
Yusuke Suzuki
Comment 7 2022-04-21 16:08:25 PDT
Comment on attachment 458095 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458095&action=review Thank you! >> Source/JavaScriptCore/ChangeLog:10 >> + ScratchRegisterAllocator. > > I suggest slightly rephrasing this as follows: > > We can always use RegisterSet. TempRegisterSet can save several bytes, but we have no code using TempRegisterSet in > heap-allocated classes. So, this does not make sense anymore. Instead of TempRegisterSet, we will consistently use > RegisterSet to pass register info and ScratchRegisterAllocator to manage allocation of temp / scratch registers. Sounds good, changed. >> Source/JavaScriptCore/ChangeLog:14 >> + TempRegisterSet. This is very fragile and dangerous. We should pass scratch register explicitly in that case. > > We also remove the copyCalleeSavesToEntryFrameCalleeSavesBuffer function which takes no scratch register. It was > using TempRegisterSet to allocate a scratch register, but the caller of this function was making assumptions on how > TempRegisterSet will allocate that scratch. This is very fragile and dangerous. We should explicitly pass a scratch > register instead in that case. Changed.
Yusuke Suzuki
Comment 8 2022-04-21 17:52:05 PDT
Note You need to log in before you can comment on or make changes to this bug.