RESOLVED FIXED 133425
Add a LazyNeverDestroyed class template and use it
https://bugs.webkit.org/show_bug.cgi?id=133425
Summary Add a LazyNeverDestroyed class template and use it
Anders Carlsson
Reported 2014-05-31 13:35:05 PDT
Add a LazyNeverDestroyed class template and use it
Attachments
Patch (19.48 KB, patch)
2014-05-31 13:42 PDT, Anders Carlsson
no flags
Patch (19.55 KB, patch)
2014-05-31 15:35 PDT, Anders Carlsson
no flags
Patch (19.34 KB, patch)
2014-05-31 16:32 PDT, Anders Carlsson
no flags
Patch (19.47 KB, patch)
2014-05-31 16:53 PDT, Anders Carlsson
no flags
Patch (19.67 KB, patch)
2014-06-01 08:36 PDT, Anders Carlsson
no flags
Patch (19.73 KB, patch)
2014-06-01 10:15 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2014-05-31 13:42:16 PDT
Darin Adler
Comment 2 2014-05-31 15:00:33 PDT
Comment on attachment 232321 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232321&action=review > Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp:43 > + functionWhitelist.construct(Options::dfgFunctionWhitelistFile()); Bug in the Windows compiler? 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/NeverDestroyed.h(91): error C2248: 'JSC::DFG::FunctionWhitelist::FunctionWhitelist' : cannot access private member declared in class 'JSC::DFG::FunctionWhitelist' (..\dfg\DFGFunctionWhitelist.cpp) c:\cygwin\home\buildbot\webkit\source\javascriptcore\dfg\DFGFunctionWhitelist.h(46) : see declaration of 'JSC::DFG::FunctionWhitelist::FunctionWhitelist' c:\cygwin\home\buildbot\webkit\source\javascriptcore\dfg\DFGFunctionWhitelist.h(38) : see declaration of 'JSC::DFG::FunctionWhitelist' ..\dfg\DFGFunctionWhitelist.cpp(43) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<JSC::DFG::FunctionWhitelist>::construct<JSC::optionString&>(JSC::optionString &)' being compiled ..\dfg\DFGFunctionWhitelist.cpp(43) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<JSC::DFG::FunctionWhitelist>::construct<JSC::optionString&>(JSC::optionString &)' being compiled > Source/WTF/wtf/Forward.h:30 > +template<typename T> class LazyNeverDestroyed; > template<typename T> class NeverDestroyed; Are these two forward declarations ever helpful? > Source/WTF/wtf/NeverDestroyed.h:126 > using WTF::NeverDestroyed; Should the plain old NeverDestroyed be reimplemented using LazyNeverDestroyed?
Anders Carlsson
Comment 3 2014-05-31 15:31:39 PDT
(In reply to comment #2) > (From update of attachment 232321 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=232321&action=review > > > Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp:43 > > + functionWhitelist.construct(Options::dfgFunctionWhitelistFile()); > > Bug in the Windows compiler? > > 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/NeverDestroyed.h(91): error C2248: 'JSC::DFG::FunctionWhitelist::FunctionWhitelist' : cannot access private member declared in class 'JSC::DFG::FunctionWhitelist' (..\dfg\DFGFunctionWhitelist.cpp) > c:\cygwin\home\buildbot\webkit\source\javascriptcore\dfg\DFGFunctionWhitelist.h(46) : see declaration of 'JSC::DFG::FunctionWhitelist::FunctionWhitelist' > c:\cygwin\home\buildbot\webkit\source\javascriptcore\dfg\DFGFunctionWhitelist.h(38) : see declaration of 'JSC::DFG::FunctionWhitelist' > ..\dfg\DFGFunctionWhitelist.cpp(43) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<JSC::DFG::FunctionWhitelist>::construct<JSC::optionString&>(JSC::optionString &)' being compiled > ..\dfg\DFGFunctionWhitelist.cpp(43) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<JSC::DFG::FunctionWhitelist>::construct<JSC::optionString&>(JSC::optionString &)' being compiled Hmm, I'll see what I can do to fix it. > > > Source/WTF/wtf/Forward.h:30 > > +template<typename T> class LazyNeverDestroyed; > > template<typename T> class NeverDestroyed; > > Are these two forward declarations ever helpful? They are useful for friend declarations. > > > Source/WTF/wtf/NeverDestroyed.h:126 > > using WTF::NeverDestroyed; > > Should the plain old NeverDestroyed be reimplemented using LazyNeverDestroyed? I had done that initially, but then I had to change all friend declarations to use LazyNeverDestroyed.
Anders Carlsson
Comment 4 2014-05-31 15:35:34 PDT
Anders Carlsson
Comment 5 2014-05-31 16:32:54 PDT
Anders Carlsson
Comment 6 2014-05-31 16:53:31 PDT
Darin Adler
Comment 7 2014-05-31 20:52:37 PDT
Comment on attachment 232326 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232326&action=review > Source/WebCore/workers/DefaultSharedWorkerRepository.h:60 > + friend class LazyNeverDestroyed<DefaultSharedWorkerRepository>; 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/NeverDestroyed.h(91): error C2248: 'WebCore::DefaultSharedWorkerRepository::DefaultSharedWorkerRepository' : cannot access private member declared in class 'WebCore::DefaultSharedWorkerRepository' (..\workers\DefaultSharedWorkerRepository.cpp) c:\cygwin\home\buildbot\webkit\source\webcore\workers\DefaultSharedWorkerRepository.h(82) : see declaration of 'WebCore::DefaultSharedWorkerRepository::DefaultSharedWorkerRepository' c:\cygwin\home\buildbot\webkit\source\webcore\workers\DefaultSharedWorkerRepository.h(58) : see declaration of 'WebCore::DefaultSharedWorkerRepository' ..\workers\DefaultSharedWorkerRepository.cpp(337) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<WebCore::DefaultSharedWorkerRepository>::construct<>(void)' being compiled ..\workers\DefaultSharedWorkerRepository.cpp(337) : see reference to function template instantiation 'void WTF::LazyNeverDestroyed<WebCore::DefaultSharedWorkerRepository>::construct<>(void)' being compiled
Anders Carlsson
Comment 8 2014-06-01 08:36:50 PDT
Anders Carlsson
Comment 9 2014-06-01 10:15:04 PDT
Anders Carlsson
Comment 10 2014-06-01 15:31:42 PDT
Note You need to log in before you can comment on or make changes to this bug.