Enable JSC stress tests for the rest of non-Windows platforms
https://bugs.webkit.org/show_bug.cgi?id=121021

Reviewed by Filip Pizlo.

The JSC stress tests can already be enabled on Linux-based ports.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunJavaScriptCoreTests.commandComplete): Reformulate the regular expressions used to find the number of regressed
JSC tests of various test suites. The expressions now look for the suite-specific report compartment over the
complete output, with the number of failing or crashing tests properly extracted.
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Add a couple of unit tests and expand the tested
output in other unit tests testing the parsing of the output in the new format.
(test_jsc_stress_failure_new_output):
(test_fast_js_crashes_and_jsc_stress_failures_new_output):
* Scripts/run-javascriptcore-tests: Enable the JSC stress tests on all but the Apple Win port.
* Scripts/run-jsc-stress-tests: `sysctl -n hw.availcpu` doesn't work on Linux-based ports but the numProcesses
variable is still gracefully assigned a zero value. In that case, try running `nproc --all` to gather the number
of available CPUs so the stress tests can be run in parallel.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] PDFDocumentImage should use PDFKit to draw
https://bugs.webkit.org/show_bug.cgi?id=120651
<rdar://problem/12810731>

Unreviewed hopeful build fix.

* platform/graphics/mac/PDFDocumentImageMac.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
needsFocus is always undefined in grammar-paste.html
https://bugs.webkit.org/show_bug.cgi?id=121097

Reviewed by Darin Adler.

Remove unnecessary needsFocus parameter which is always undefined.
In addition, remove if (true) condition in the test.

* editing/spelling/grammar-paste.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up wtf/Noncopyable.h
https://bugs.webkit.org/show_bug.cgi?id=121115

Reviewed by Darin Adler.

Use std::aligned_storage instead of WTF::AlignedBuffer.

* wtf/NeverDestroyed.h:
(WTF::NeverDestroyed::NeverDestroyed):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [JSC] Caught exception is treated as uncaught
https://bugs.webkit.org/show_bug.cgi?id=93607

Reviewed by Geoff Garen.

Source/JavaScriptCore:

Check up the entire call stack to see if there is an exception handler.

* interpreter/Interpreter.cpp:
(JSC::GetExceptionHandlerFunctor::GetExceptionHandlerFunctor):
(JSC::GetExceptionHandlerFunctor::handler):
(JSC::GetExceptionHandlerFunctor::operator()):

LayoutTests:

Add tests for different inspector pause on exceptions states.

* inspector-protocol/debugger/resources/exception.js: Added.
* inspector-protocol/debugger/setPauseOnExceptions-all-expected.txt: Added.
* inspector-protocol/debugger/setPauseOnExceptions-all.html: Added.
* inspector-protocol/debugger/setPauseOnExceptions-none-expected.txt: Added.
* inspector-protocol/debugger/setPauseOnExceptions-none.html: Added.
* inspector-protocol/debugger/setPauseOnExceptions-uncaught-expected.txt: Added.
* inspector-protocol/debugger/setPauseOnExceptions-uncaught.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix race in fast/loader/onunload-form-submit-crash.html
https://bugs.webkit.org/show_bug.cgi?id=121122

Reviewed by Alexey Proskuryakov.

Merge https://chromium.googlesource.com/chromium/blink/+/c7ab0900c147f9a2f4c69d62b6460f98abc5d796

The setTimeout was sometimes firing before the form was parsed, so document.myForm would be null.

* fast/loader/onunload-form-submit-crash.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support WeakMap
https://bugs.webkit.org/show_bug.cgi?id=120912

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add support for ES6 WeakMap.  Add the cluster of boilerplate
classes around the core WeakMapData class.

WeakMapData is a simple object->value hash table that uses a
combo of WeakReferenceHarvester to conditionally keep the weak
value reference live, and UnconditionalFinalizer to clean the
dead keys from the table post-GC.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::weakMapDataStructure):
* runtime/JSWeakMap.cpp: Added.
(JSC::JSWeakMap::finishCreation):
(JSC::JSWeakMap::visitChildren):
* runtime/JSWeakMap.h: Added.
(JSC::JSWeakMap::createStructure):
(JSC::JSWeakMap::create):
(JSC::JSWeakMap::weakMapData):
(JSC::JSWeakMap::JSWeakMap):
* runtime/WeakMapConstructor.cpp: Added.
(JSC::WeakMapConstructor::finishCreation):
(JSC::constructWeakMap):
(JSC::WeakMapConstructor::getConstructData):
(JSC::WeakMapConstructor::getCallData):
* runtime/WeakMapConstructor.h: Added.
(JSC::WeakMapConstructor::create):
(JSC::WeakMapConstructor::createStructure):
(JSC::WeakMapConstructor::WeakMapConstructor):
* runtime/WeakMapData.cpp: Added.
(JSC::WeakMapData::WeakMapData):
(JSC::WeakMapData::finishCreation):
(JSC::WeakMapData::destroy):
(JSC::WeakMapData::visitChildren):
(JSC::WeakMapData::set):
(JSC::WeakMapData::get):
(JSC::WeakMapData::remove):
(JSC::WeakMapData::contains):
(JSC::WeakMapData::clear):
(JSC::WeakMapData::DeadKeyCleaner::visitWeakReferences):
(JSC::WeakMapData::DeadKeyCleaner::finalizeUnconditionally):
* runtime/WeakMapData.h: Added.
(JSC::WeakMapData::create):
(JSC::WeakMapData::createStructure):
(JSC::WeakMapData::DeadKeyCleaner::DeadKeyCleaner):
* runtime/WeakMapPrototype.cpp: Added.
(JSC::WeakMapPrototype::finishCreation):
(JSC::getWeakMapData):
(JSC::protoFuncWeakMapClear):
(JSC::protoFuncWeakMapDelete):
(JSC::protoFuncWeakMapGet):
(JSC::protoFuncWeakMapHas):
(JSC::protoFuncWeakMapSet):
* runtime/WeakMapPrototype.h: Added.
(JSC::WeakMapPrototype::create):
(JSC::WeakMapPrototype::createStructure):
(JSC::WeakMapPrototype::WeakMapPrototype):

LayoutTests:

Basic tests.

* js/basic-weakmap-expected.txt: Added.
* js/basic-weakmap.html: Added.
* js/script-tests/basic-weakmap.js: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove more uses of WTF::AlignedBuffer
https://bugs.webkit.org/show_bug.cgi?id=121119

Reviewed by Andreas Kling.

* wtf/HashTable.h:
* wtf/SizeLimits.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] WebInspector: Move to new webinspector
https://bugs.webkit.org/show_bug.cgi?id=119559

.:

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-09-10
Reviewed by Gyuyoung Kim.

Enabling the new Web Inspector on EFL port.
Co-author: Andre Loureiro <andre.vl@samsung.com>

* Source/PlatformEfl.cmake:
* Source/cmake/OptionsEfl.cmake:

Source/WebKit/efl:

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-09-10
Reviewed by Gyuyoung Kim.

Loading the new Web Inspector page instead of the old inspector.
Co-author: Andre Loureiro <andre.vl@samsung.com>

* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorClientEfl::openInspectorFrontend):

Source/WebKit2:

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-09-10
Reviewed by Gyuyoung Kim.

Loading the new Web Inspector page instead of the old inspector.
Co-Author: Andre Loureiro <andre.vl@samsung.com>

* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::inspectorPageURL):

LayoutTests:

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-09-10
Reviewed by Gyuyoung Kim.

Skipping the tests for the old inspector.

* platform/efl-wk1/TestExpectations:
* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Create SharedGDIObject Class Template
https://bugs.webkit.org/show_bug.cgi?id=121037

Reviewed by Anders Carlsson.

Source/WebCore: 

* WebCore.vcxproj/WebCore.vcxproj: Remove RefCountedGDIHandle.h, and
add new SharedGDIObject.h file.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hfont): Switch to new SharedGDIObject.
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Ditto.
* platform/graphics/win/RefCountedGDIHandle.h: Removed.
* platform/graphics/win/SharedGDIObject.h: Added.
(WebCore::SharedGDIObject::create):
(WebCore::SharedGDIObject::get):
(WebCore::SharedGDIObject::hash):
(WebCore::SharedGDIObject::SharedGDIObject):

Source/WebKit/win: 

* WebView.cpp: Change implementations to use the new SharedGDIObject
class.
(WebView::addToDirtyRegion):
(WebView::scrollBackingStore):
(WebView::updateBackingStore):
(WebView::performLayeredWindowUpdate):
(WebView::paint):
(WebView::backingStore):
* WebView.h: Ditto.

Source/WTF: 

Now that the SharedGDIObject class exists we can get rid of
the Windows-specific code in OwnPtr.

* WTF.vcxproj/WTF.vcxproj: Remove OwnPtrWin.cpp.
* WTF.vcxproj/WTF.vcxproj.filters: Ditto.
* wtf/OwnPtrCommon.h: 
(WTF::deleteOwnedPtr): Remove Windows declarations that
are no longer needed.
* wtf/win/GDIObject.h:
(WTF::GDIObject::get): Change to 'const' to match
signature (and use cases) elsewhere in the code base for
our smart pointer classes.
* wtf/win/OwnPtrWin.cpp: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Split MediaStreamDescriptor.h and MediaStreamComponent.h into .h and .cpp
https://bugs.webkit.org/show_bug.cgi?id=120878

Reviewed by Jer Noble.

No new tests, no functional change.

* CMakeLists.txt: Add MediaStreamComponent.cpp and MediaStreamDescriptor.cpp.
* GNUmakefile.list.am: Ditto.

* Modules/mediastream/LocalMediaStream.cpp:
(WebCore::LocalMediaStream::create): MediaStreamDescriptor::create() doesn't take a UUID.

* Modules/mediastream/MediaStream.cpp:
(WebCore::createFromSourceVectors): Ditto.

* WebCore.xcodeproj/project.pbxproj: Add MediaStreamComponent.cpp and MediaStreamDescriptor.cpp.

* platform/mediastream/MediaStreamComponent.cpp: Added.
* platform/mediastream/MediaStreamComponent.h:

* platform/mediastream/MediaStreamDescriptor.cpp: Added.
* platform/mediastream/MediaStreamDescriptor.h:


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