Bug 236387

Summary: Use local variable pointer for concurrently load value
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch saam: review+

Yusuke Suzuki
Reported 2022-02-09 11:28:35 PST
Use WTF::opaque in some places to ensure access is done only once
Attachments
Patch (15.05 KB, patch)
2022-02-09 11:33 PST, Yusuke Suzuki
ews-feeder: commit-queue-
Patch (15.16 KB, patch)
2022-02-09 13:32 PST, Yusuke Suzuki
no flags
Patch (14.86 KB, patch)
2022-02-09 15:03 PST, Yusuke Suzuki
saam: review+
Yusuke Suzuki
Comment 1 2022-02-09 11:33:01 PST
Yusuke Suzuki
Comment 2 2022-02-09 13:32:22 PST
Saam Barati
Comment 3 2022-02-09 14:56:50 PST
Comment on attachment 451436 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451436&action=review I wonder if it's just better to change Weak to do the thing where it doesn't use m_impl in multiple places than to change the code to use opaque everywhere. I don't think llvm in practice will ever emit a load from a field twice when the program says to do it once, even if it can prove that such a heap location hasn't changed > Source/JavaScriptCore/runtime/WriteBarrier.h:140 > + explicit operator bool() const { return !!cell(); } > > - bool operator!() const { return !m_cell; } > + bool operator!() const { return !cell(); } Why do these need to use the opaque version?
Yusuke Suzuki
Comment 4 2022-02-09 15:00:29 PST
Comment on attachment 451436 [details] Patch Hmmm, not sure whether just using `m_impl` once is enough or not, probably it is not enough in terms of the C spec, but yeah, in the current build, it would be OK. I'll remove WTF::opaque for now.
Yusuke Suzuki
Comment 5 2022-02-09 15:03:05 PST
Yusuke Suzuki
Comment 6 2022-02-09 17:50:17 PST
Radar WebKit Bug Importer
Comment 7 2022-02-09 17:51:16 PST
Note You need to log in before you can comment on or make changes to this bug.