Summary: | Add a LazyNeverDestroyed class template and use it | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||||||||||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | benjamin, cmarcelo, commit-queue, japhet | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Attachments: |
|
Description
Anders Carlsson
2014-05-31 13:35:05 PDT
Created attachment 232321 [details]
Patch
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? (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. Created attachment 232323 [details]
Patch
Created attachment 232324 [details]
Patch
Created attachment 232326 [details]
Patch
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 Created attachment 232344 [details]
Patch
Created attachment 232347 [details]
Patch
Committed r169518: <http://trac.webkit.org/changeset/169518> |