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
Make MediaStream objects ScriptWrappable
https://bugs.webkit.org/show_bug.cgi?id=120879

Reviewed by Jer Noble.

* Modules/mediastream/MediaStream.h: Inherit from ScriptWrappable.
* Modules/mediastream/MediaStreamTrack.h: Ditto.
* Modules/mediastream/RTCDTMFSender.h: Ditto.
* Modules/mediastream/RTCDataChannel.h: Ditto.
* Modules/mediastream/RTCIceCandidate.h: Ditto.
* Modules/mediastream/RTCPeerConnection.h: Ditto.
* Modules/mediastream/RTCSessionDescription.h: Ditto.
* Modules/mediastream/RTCStatsReport.h: Ditto.
* Modules/mediastream/RTCStatsResponse.h: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace remaining "fast js" names in scripts.
https://bugs.webkit.org/show_bug.cgi?id=120899.

Rubber stamped by Filip Pizlo.

* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(test_layout_failure_new_output):
(test_layout_crash_new_output):
(test_mozilla_and_layout_failure_new_output):
* Scripts/run-fast-jsc: Removed.
* Scripts/run-javascriptcore-tests:
* Scripts/run-layout-jsc: Copied from Tools/Scripts/run-fast-jsc.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce a SpecInt48 type and be more careful about what we mean by "Top"
https://bugs.webkit.org/show_bug.cgi?id=121116

Reviewed by Oliver Hunt.
        
SpecInt48 will mean that we have something that would be a double if it was a JSValue,
but it's profitable to represent it as something other than a double.
        
SpecInt48AsDouble means that it has a value that could have been represented like
SpecInt48, but we're making a heuristic decision not to do it.

* bytecode/SpeculatedType.h:
(JSC::isInt48Speculation):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
(JSC::DFG::::clobberCapturedVars):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::filter):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::makeHeapTop):
(JSC::DFG::AbstractValue::makeBytecodeTop):
(JSC::DFG::AbstractValue::isHeapTop):
(JSC::DFG::AbstractValue::heapTop):
(JSC::DFG::AbstractValue::validateType):
(JSC::DFG::AbstractValue::validate):
(JSC::DFG::AbstractValue::makeTop):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::noticeOSREntry):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][JHBUILD] Use a tarball for libseccomp, instead of git
https://bugs.webkit.org/show_bug.cgi?id=121114

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-09-10
Reviewed by Christophe Dumez.

Use a tarball for libseccomp instead of git to avoid network issues on
the buildbots while checking out the git repo. Using tarballs has the
advantage of them being cached if the checksum matches, in which case
there will be no need to download them again.

* efl/jhbuild.modules:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
We should say Int32 when we mean Int32. Saying Integer is just weird.

Rubber stamped by Mark Hahnenberg.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToPrimitive):
(JSC::DFG::FixupPhase::fixIntEdge):
(JSC::DFG::FixupPhase::truncateConstantsIfNecessary):
(JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::addSpeculationMode):
(JSC::DFG::Graph::valueAddSpeculationMode):
(JSC::DFG::Graph::arithAddSpeculationMode):
(JSC::DFG::Graph::addShouldSpeculateInt32):
(JSC::DFG::Graph::mulShouldSpeculateInt32):
(JSC::DFG::Graph::negateShouldSpeculateInt32):
(JSC::DFG::Graph::addImmediateShouldSpeculateInt32):
(JSC::DFG::Graph::mulImmediateShouldSpeculateInt32):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateInt32):
(JSC::DFG::Node::shouldSpeculateInt32ForArithmetic):
(JSC::DFG::Node::shouldSpeculateInt32ExpectingDefined):
(JSC::DFG::Node::canSpeculateInt32):
* dfg/DFGNodeFlags.h:
(JSC::DFG::nodeCanSpeculateInt32):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::arrayify):
(JSC::DFG::GPRTemporary::GPRTemporary):
(JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileAdd):
(JSC::DFG::SpeculativeJIT::compileArithSub):
(JSC::DFG::SpeculativeJIT::compileArithNegate):
(JSC::DFG::SpeculativeJIT::compileArithIMul):
(JSC::DFG::SpeculativeJIT::compileArithMul):
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithMod):
(JSC::DFG::SpeculativeJIT::compileNewTypedArray):
(JSC::DFG::SpeculativeJIT::speculateInt32):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculateInt32Operand::SpeculateInt32Operand):
(JSC::DFG::SpeculateInt32Operand::~SpeculateInt32Operand):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileIntegerCompare):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileIntegerCompare):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r155476.

* GNUmakefile.list.am: Remove reference to deleted OwnPtrWin.cpp file.
* WTF.pro: Ditto.
* wtf/CMakeLists.txt: Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More WTF/Alignment.h removal
https://bugs.webkit.org/show_bug.cgi?id=121125

Reviewed by Andreas Kling.

Source/WebCore:

* platform/PODArena.h:

Source/WTF:

* wtf/Alignment.h:
* wtf/Vector.h:
(WTF::VectorBuffer::swap):
(WTF::VectorBuffer::inlineBuffer):
* wtf/text/ASCIIFastPath.h:
(WTF::isAlignedTo):
(WTF::isAlignedToMachineWord):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AnimationController should have a Frame& internally.
<https://webkit.org/b/121078>

Reviewed by Anders Carlsson.

The AnimationController is owned by the Frame so make the back-pointer
a reference. This knocks off a couple of null checks.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix EFL build after r155477
https://bugs.webkit.org/show_bug.cgi?id=121126

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-09-10
Reviewed by Antonio Gomes.

No new tests, build fix.

* CMakeLists.txt: MediaStreamComponent.cpp and MediaStreamDescriptor.cpp
were added with an incorrect path.

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