[GTK][WK2] Blocks when fetching plugins information
https://bugs.webkit.org/show_bug.cgi?id=115650

Reviewed by Gustavo Noronha Silva.

Use a persistent cache to store the plugins metadata to avoid
having to load all the plugins everytime a plugin is used for the
first time.

* GNUmakefile.am:
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::NetscapePluginModule::parseMIMEDescription): Make this
method public.
(WebKit::NetscapePluginModule::buildMIMEDescription): Added this
helper to build the MIME description string.
* UIProcess/Plugins/gtk/PluginInfoCache.cpp: Added.
(WebKit::PluginInfoCache::shared):
(WebKit::PluginInfoCache::PluginInfoCache):
(WebKit::PluginInfoCache::~PluginInfoCache):
(WebKit::PluginInfoCache::saveToFileIdleCallback):
(WebKit::PluginInfoCache::saveToFile):
(WebKit::PluginInfoCache::getPluginInfo):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/gtk/PluginInfoCache.h: Added.
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::getPluginInfo): Check first if we have
metadata of the plugin in the cache and update the cache if we
loaded the plugin to get its metadata.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Look up already existing VisitedLinkTableController objects by identifier
https://bugs.webkit.org/show_bug.cgi?id=129431

Reviewed by Dan Bernstein.

* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::visitedLinkTableControllers):
(WebKit::VisitedLinkTableController::getOrCreate):
(WebKit::VisitedLinkTableController::VisitedLinkTableController):
(WebKit::VisitedLinkTableController::~VisitedLinkTableController):
* WebProcess/WebPage/VisitedLinkTableController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added svn:ignore to two directories, so that .pyc files don't show up as unversioned.

* inspector/scripts: Added property svn:ignore.
* replay/scripts: Added property svn:ignore.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Octane/closure thrashes between flattening dictionaries during global object initialization in a global eval
https://bugs.webkit.org/show_bug.cgi?id=129435

Reviewed by Oliver Hunt.
        
This is a 5-10% speed-up on Octane/closure.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionClearCodeCache):
* runtime/BatchedTransitionOptimizer.h:
(JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
(JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix 32-bit V_JITOperation_EJ callOperation introduced in r162652.
https://bugs.webkit.org/show_bug.cgi?id=129420

Patch by Julien Brianceau <jbriance@cisco.com> on 2014-02-27
Reviewed by Geoffrey Garen.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation): Payload and tag are swapped.
Also, EABI_32BIT_DUMMY_ARG is missing for arm EABI and mips.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Auto generate bytecode information for bytecode parser and LLInt
https://bugs.webkit.org/show_bug.cgi?id=129181

Reviewed by Mark Lam.

Source/JavaScriptCore: 

Added new bytecode/BytecodeList.json that contains a list of bytecodes and related
helpers.  It also includes bytecode length and other information used to generate files.
Added a new generator, generate-bytecode-files that generates Bytecodes.h and InitBytecodes.asm
in DerivedSources/JavaScriptCore/.

Added the generation of these files to the "DerivedSource" build step.
Slighty changed the build order, since the Bytecodes.h file is needed by
JSCLLIntOffsetsExtractor.  Moved the offline assembly to a separate step since it needs
to be run after JSCLLIntOffsetsExtractor.

Made related changes to OPCODE macros and their use.

Added JavaScriptCore.framework/PrivateHeaders to header file search path for building
jsc to resolve Mac build issue.

* CMakeLists.txt:
* Configurations/JSC.xcconfig:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.vcxproj/copy-files.cmd:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/Opcode.h:
(JSC::padOpcodeName):
* llint/LLIntCLoop.cpp:
(JSC::LLInt::CLoop::initialize):
* llint/LLIntCLoop.h:
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntOpcode.h:
* llint/LowLevelInterpreter.asm:

Source/WebKit: 

Added ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} to WebKit_INCLUDE_DIRECTORIES due to new
generated Bytecodes.h include file.

* CMakeLists.txt:

Source/WebKit2: 

Added ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} to WebKit2_INCLUDE_DIRECTORIES due to new
generated Bytecodes.h include file.

* CMakeLists.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSType upper limit (0xff) assertion can be removed.
https://bugs.webkit.org/show_bug.cgi?id=129424

Patch by Gergo Balogh <gbalogh.u-szeged@partner.samsung.com> on 2014-02-27
Reviewed by Geoffrey Garen.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Remove unused SPI declarations from WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129434

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKView.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion failure at CachedResource.h:196: ASSERT(!m_purgeableData)
https://bugs.webkit.org/show_bug.cgi?id=129349
<rdar://problem/14871837>

Reviewed by Joseph Pecoraro.

The code for clearing out memory mapped notification callbacks is only needed when loading
PDFs. And in such cases, we always have dataSourceDelegate object. So make this code
conditional on its presence so that we don't trigger the assert for non-PDF main resources.

* WebView/WebDataSource.mm:
(-[WebDataSource dealloc]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][WK2] Remove hardcoded Cmd+B and Cmd+I from WKView.mm
https://bugs.webkit.org/show_bug.cgi?id=129436

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm: Removed a historic WebKit1 behavior that we don't
need to preserve in WebKit2.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Math.{max, min}() must not return after first NaN value
https://bugs.webkit.org/show_bug.cgi?id=104147

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-02-27
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

According to the spec, ToNumber going to be called on each argument
even if a `NaN` value was already found

* runtime/MathObject.cpp:
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):

LayoutTests:

Extended the Math.{max, min}() tests, to check that these methods are return after first NaN value or not.

* js/math-expected.txt:
* js/script-tests/math.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make WebProcessProxy::pages() return an IteratorRange
https://bugs.webkit.org/show_bug.cgi?id=129440

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKPage.cpp:
(WKPageCopyRelatedPages):
Move the implementation of WebPageProxy::relatedPages here.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcessRespectingProcessCountLimit):
Use std::min_element here instead of a manual loop.

* UIProcess/WebPageProxy.cpp:
Remove WebPageProxy::relatedPages().

* UIProcess/WebProcessProxy.cpp:
Remove WebProcessProxy::pages().

* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::pages):
Make this return an IteratorRange.

(WebKit::WebProcessProxy::pageCount):
New function that returns the page count.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164820 268f45cc-cd09-0410-ab3c-d52691b4dbfc