Bug 262660 - NativePromise unnecessarily calls crossThreadCopy with the completion promise
Summary: NativePromise unnecessarily calls crossThreadCopy with the completion promise
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-04 15:40 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-10-09 07:54 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-10-04 15:40:29 PDT
In bug 262437, changes were made to call crossThreadCopy when needed.

When we have a completion promise, which will in its turn be resolved/rejected with the resolve/reject value again, we call once again crossThreadCopy on the value as it's using a common code path for resolving/rejecting it.

We could easily distinguish the case from the standard resolve/reject and not call crossThreadCopy() then (though this one is mostly a no-op as we are simply moving the value)
Comment 1 Radar WebKit Bug Importer 2023-10-04 15:40:55 PDT
<rdar://problem/116489817>
Comment 2 Jean-Yves Avenard [:jya] 2023-10-04 18:01:34 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18664
Comment 3 EWS 2023-10-09 07:54:48 PDT
Committed 269075@main (0e9b295049f8): <https://commits.webkit.org/269075@main>

Reviewed commits have been landed. Closing PR #18664 and removing active labels.