Bug 237503

Summary: Optimize VMTraps::maybeNeedHandling().
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. none

Mark Lam
Reported 2022-03-05 11:22:27 PST
There's no need for VMTraps::maybeNeedHandling() to mask the VMTraps bits for events. Under normal circumstances, there are no traps firing and the traps bits are 0 anyway. We should optimize for this and do away with the masking. Clients who use VMTraps::maybeNeedHandling() should and current does call VMTraps::needHandling() to get the real story on whether there are actually traps to handle or not. Hence, the masking in VMTraps::maybeNeedHandling() is also not needed for correctness.
Attachments
proposed patch. (3.32 KB, patch)
2022-03-05 11:29 PST, Mark Lam
no flags
Mark Lam
Comment 1 2022-03-05 11:29:55 PST
Created attachment 453916 [details] proposed patch.
Saam Barati
Comment 2 2022-03-05 12:58:01 PST
Comment on attachment 453916 [details] proposed patch. Going back to r?. They’re non zero when we defer, which may happen frequently?
Saam Barati
Comment 3 2022-03-05 12:58:33 PST
(In reply to Saam Barati from comment #2) > Comment on attachment 453916 [details] > proposed patch. > > Going back to r?. They’re non zero when we defer, which may happen > frequently? Maybe not frequently enough though. Might be worth just giving a bit of thought to defer% to non-defer%
Mark Lam
Comment 4 2022-03-05 13:00:38 PST
(In reply to Saam Barati from comment #3) > (In reply to Saam Barati from comment #2) > > Comment on attachment 453916 [details] > > proposed patch. > > > > Going back to r?. They’re non zero when we defer, which may happen > > frequently? > > Maybe not frequently enough though. Might be worth just giving a bit of > thought to defer% to non-defer% I think that would be rare in a few sites only. We shouldn't be penalizing all exception check sites to favor just a few defer sites. Plus if bots show a regression, we can just roll this back.
Saam Barati
Comment 5 2022-03-05 13:08:16 PST
Comment on attachment 453916 [details] proposed patch. r=me
Mark Lam
Comment 6 2022-03-05 13:11:27 PST
Comment on attachment 453916 [details] proposed patch. Thanks for the review.
EWS
Comment 7 2022-03-05 13:56:47 PST
Committed r290871 (248102@main): <https://commits.webkit.org/248102@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453916 [details].
Radar WebKit Bug Importer
Comment 8 2022-03-05 13:57:17 PST
Note You need to log in before you can comment on or make changes to this bug.