Bug 262660

Summary: NativePromise unnecessarily calls crossThreadCopy with the completion promise
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: Web Template FrameworkAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=262437

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.