[JSC] Use LazyNeverDestroyed & std::call_once for complex singletons
Created attachment 405972 [details] Patch
<rdar://problem/65718983>
Created attachment 405973 [details] Patch
Created attachment 405975 [details] Patch
Comment on attachment 405975 [details] Patch r=me
stress/put-by-val-direct-putprivate.js.dfg-eager is failing recently.
Committed r265276: <https://trac.webkit.org/changeset/265276> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405975 [details].
Should we have a class that contains the std::once and whatnot? Maybe call it ConcurrentLazyNeverDestroyed or something?
What's the logic in the commit? > WebKit's static does not have thread-safety. Isn't the deduction against c++11 spec? Function local static initialization is specified to be thread-safe? Here is example: https://godbolt.org/z/jcMz9M11d Here is discussion: https://stackoverflow.com/questions/26013650/threadsafe-lazy-initialization-static-vs-stdcall-once-vs-double-checked-locki/27206650 What makes WebKit statics broken? Asking because I see plenty of static uses in WebKit that rely on this...
(In reply to Kimmo Kinnunen from comment #9) > What's the logic in the commit? > > > WebKit's static does not have thread-safety. > > Isn't the deduction against c++11 spec? We are explicitly disabling that in WebKit for performance reason via -fno-threadsafe-statics. Check GCC_THREADSAFE_STATICS in WebKit tree. > > Function local static initialization is specified to be thread-safe? > > Here is example: > https://godbolt.org/z/jcMz9M11d > > Here is discussion: > https://stackoverflow.com/questions/26013650/threadsafe-lazy-initialization- > static-vs-stdcall-once-vs-double-checked-locki/27206650 > > What makes WebKit statics broken? > Asking because I see plenty of static uses in WebKit that rely on this...