https://bugs.webkit.org/show_bug.cgi?id=120073
Remove use of GOPD from JSFunction::defineProperty

Reviewed by Oliver Hunt.

Call getOwnPropertySlot to check for existing properties instead.

* runtime/JSFunction.cpp:
(JSC::JSFunction::defineOwnProperty):
    - getOwnPropertyDescriptor -> getOwnPropertySlot



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120072> Use nullAtom instead of defining static local in
Accessibility{Object, RenderObject}::actionVerb()

Reviewed by Chris Fleizach.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::actionVerb):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::actionVerb):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Incorrect behavior on emscripten-compiled cube2hash
https://bugs.webkit.org/show_bug.cgi?id=120033

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
If PutClosureVar is may-aliased to another PutClosureVar or GetClosureVar
then we should bail attempts to CSE.

* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::scopedVarLoadElimination):
(JSC::DFG::CSEPhase::scopedVarStoreElimination):

LayoutTests: 

Reviewed by Mark Hahnenberg.
        
Add the test that actually failed as a JSRegress test. We should track its
performance anyway.
        
Add a regression test for the actual failure.
        
Add .html and -expected.txt files for a JSRegress test that is already in
the repo.

* fast/js/dfg-get-closure-var-put-closure-var-interference.html: Added.
* fast/js/dfg-get-closure-var-put-closure-var-interference-expected.txt: Added.
* fast/js/regress/array-nonarray-polymorhpic-access-expected.txt: Added.
* fast/js/regress/array-nonarray-polymorhpic-access.html: Added.
* fast/js/regress/emscripten-cube2hash-expected.txt: Added.
* fast/js/regress/emscripten-cube2hash.html: Added.
* fast/js/regress/script-tests/emscripten-cube2hash.js: Added.
(.Module.string_appeared_here):
(else.Module.string_appeared_here):
(else.else.Module.string_appeared_here):
(else.else):
(globalEval):
(Runtime.stackSave):
(Runtime.stackRestore):
(Runtime.forceAlign):
(Runtime.isNumberType):
(Runtime.isPointerType):
(Runtime.isStructType):
(or64):
(and64):
(xor64):
(getNativeTypeSize):
(getNativeFieldSize):
(dedup):
(.set var):
(getAlignSize):
(calculateStructAlignment):
(.else.alignment):
(generateStructInfo):
(dynCall):
(addFunction):
(removeFunction):
(warnOnce):
(.Runtime.funcWrappers.func):
(getFuncWrapper):
(UTF8Processor.this.processCChar):
(UTF8Processor.this.processJSString):
(UTF8Processor):
(stackAlloc):
(staticAlloc):
(dynamicAlloc):
(alignMemory):
(makeBigInt):
(assert):
(ccall):
(getCFunc):
(.toC):
(.fromC):
(ccallFunc):
(setValue):
(getValue):
(.set else):
(.set return):
(allocate):
(Pointer_stringify):
(alignMemoryPage):
(enlargeMemory):
(callRuntimeCallbacks):
(preRun):
(ensureInitRuntime):
(preMain):
(exitRuntime):
(postRun):
(addOnPreRun):
(addOnInit):
(addOnPreMain):
(addOnExit):
(addOnPostRun):
(intArrayFromString):
(intArrayToString):
(writeStringToMemory):
(writeArrayToMemory):
(unSign):
(reSign):
(Math.string_appeared_here):
(addRunDependency):
(removeRunDependency):
(loadMemoryInitializer.applyData):
(loadMemoryInitializer.set addOnPreRun):
(__ATINIT__.push):
(STATIC_BASE):
(copyTempDouble):
(___setErrNo):
(PATH.splitPath):
(PATH.normalizeArray):
(PATH.normalize.join):
(PATH.normalize):
(PATH.dirname):
(PATH.basename):
(PATH.join):
(PATH.trim):
(PATH.relative):
(TTY.register):
(TTY.stream_ops.open):
(TTY.stream_ops.close):
(TTY.stream_ops.read):
(TTY.stream_ops.write):
(TTY.default_tty_ops.get_char):
(TTY.default_tty_ops.put_char):
(TTY.default_tty1_ops.put_char):
(MEMFS.mount):
(MEMFS.create_node):
(MEMFS.node_ops.getattr):
(MEMFS.node_ops.setattr):
(MEMFS.node_ops.lookup):
(MEMFS.node_ops.mknod):
(MEMFS.node_ops.rename):
(MEMFS.node_ops.unlink):
(MEMFS.node_ops.rmdir):
(MEMFS.node_ops.readdir):
(MEMFS.node_ops.symlink):
(MEMFS.node_ops.readlink):
(MEMFS.stream_ops.set else):
(MEMFS.stream_ops.read):
(MEMFS.stream_ops.write):
(MEMFS.stream_ops.llseek):
(MEMFS.stream_ops.allocate):
(MEMFS.stream_ops.set return):
(MEMFS.stream_ops.mmap):
(_fflush):
(FS.ErrnoError):
(FS.handleFSError):
(FS.hashName):
(FS.hashAddNode):
(FS.hashRemoveNode):
(FS.lookupNode):
(FS.):
(FS.destroyNode):
(FS.isRoot):
(FS.isMountpoint):
(FS.isFile):
(FS.isDir):
(FS.isLink):
(FS.isChrdev):
(FS.isBlkdev):
(FS.isFIFO):
(FS.cwd):
(FS.var):
(FS.lookupPath):
(FS.getPath):
(FS.modeStringToFlags):
(FS.flagsToPermissionString):
(FS.nodePermissions):
(FS.mayLookup):
(FS.mayMknod):
(FS.mayCreate):
(FS.mayDelete):
(FS.mayOpen):
(FS.chrdev_stream_ops.open):
(FS.chrdev_stream_ops.llseek):
(FS.major):
(FS.minor):
(FS.makedev):
(FS.registerDevice):
(FS.getDevice):
(FS.nextfd):
(FS.getStream):
(FS.closeStream):
(FS.getMode):
(FS.joinPath):
(FS.absolutePath):
(FS.standardizePath):
(FS.findObject):
(FS.analyzePath):
(FS.createFolder):
(FS.createPath):
(FS.createFile):
(FS.createDataFile):
(FS.createDevice):
(FS.createLink):
(FS.forceLoadFile):
(FS.LazyUint8Array):
(FS.LazyUint8Array.prototype.get if):
(FS.LazyUint8Array.prototype):
(FS.LazyUint8Array.prototype.setDataGetter):
(FS.LazyUint8Array.prototype.cacheLength.doXHR):
(FS.LazyUint8Array.prototype.cacheLength):
(FS.get Object):
(FS.get var):
(FS.keys.forEach):
(FS.processData.finish):
(FS.processData):
(FS.else):
(FS.createPreloadedFile):
(FS.createDefaultDirectories):
(FS.createDefaultDevices.):
(FS.createDefaultDevices):
(FS.createStandardStreams):
(FS.staticInit):
(FS.init):
(FS.quit):
(FS.mount):
(FS.lookup):
(FS.mknod):
(FS.create):
(FS.mkdir):
(FS.mkdev):
(FS.symlink):
(FS.rename):
(FS.rmdir):
(FS.readdir):
(FS.unlink):
(FS.readlink):
(FS.stat):
(FS.lstat):
(FS.chmod):
(FS.lchmod):
(FS.fchmod):
(FS.chown):
(FS.lchown):
(FS.fchown):
(FS.truncate):
(FS.ftruncate):
(FS.utime):
(FS.open):
(FS.close):
(FS.llseek):
(FS.read):
(FS.write):
(FS.allocate):
(FS.mmap):
(_send):
(_pwrite):
(_write):
(_fwrite):
(__reallyNegative):
(.getNextArg):
(.switch.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.break):
(.switch.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.case.string_appeared_here.break):
(_fprintf):
(_printf):
(_fputs):
(_fputc):
(_puts):
(_abort):
(___errno_location):
(_sbrk.Runtime.dynamicAlloc):
(_sbrk):
(_sysconf):
(_time):
(Browser.mainLoop.pause):
(Browser.mainLoop.resume):
(Browser.mainLoop.updateStatus):
(Browser.init.imagePlugin.string_appeared_here):
(Browser.init.img.onload):
(Browser.init.img.onerror):
(Browser.init.audioPlugin.string_appeared_here):
(Browser.init.finish):
(Browser.init.fail):
(Browser.init.audio.onerror.encode64):
(Browser.init.audio.onerror):
(Browser.init.audio):
(Browser.init.else):
(Browser.init.pointerLockChange):
(Browser.init.canvas):
(Browser.init):
(Browser.destroyContext):
(Browser.fullScreenChange):
(Browser.requestFullScreen):
(Browser.requestAnimationFrame):
(Browser.safeRequestAnimationFrame):
(Browser.safeSetTimeout):
(Browser.safeSetInterval):
(Browser.getMimetype):
(Browser.getUserMedia):
(Browser.getMovementX):
(Browser.getMovementY):
(Browser.calculateMouseEvent):
(Browser.xhr.onload):
(Browser.xhrLoad):
(Browser.updateResizeListeners):
(Browser.setCanvasSize):
(Browser.setFullScreenCanvasSize):
(Browser.setWindowedCanvasSize):
(__ATINIT__.unshift):
(__ATMAIN__.push):
(__ATEXIT__.push):
(Module.string_appeared_here):
(invoke_ii):
(invoke_v):
(invoke_iii):
(invoke_vi):
(asmPrintInt):
(asmPrintFloat):
(asm):
(Runtime.stackAlloc):
(i64Math):
(i64Math.):
(Module.string_appeared_here.Module.callMain.callMain.pad):
(Module.string_appeared_here.Module.callMain):
(run.doRun):
(run.else):
(run):
(exit):
(abort):
* fast/js/script-tests/dfg-get-closure-var-put-closure-var-interference.js: Added.
(foo):
(thingy.return.bar):
(thingy.return.baz):
(thingy):
(runIt):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120068> Media controls can be attached lazily

Reviewed by Jer Noble.

Merge https://chromium.googlesource.com/chromium/blink/+/28a995486a675992f2e72f81bfabdfff05688a31.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaControls): Add AttachLazily to appendChild().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=120075
REGRESSION (r128400): BBC4 website not displaying pictures

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 

* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::createStructure): Changed the array IndexingType to be ArrayWithSlowPutArrayStorage
so that the match results will be reified before any other modification to the results array.

LayoutTests: 

Added regression tests for fix.

* fast/js/regress/regexp-match-reify-before-putbyval-expected.txt: Added.
* fast/js/regress/regexp-match-reify-before-putbyval.html: Added.
* fast/js/regress/script-tests/regexp-match-reify-before-putbyval.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119875> localeToScriptCodeForFontSelection should use hash tables with larger default capacity

Reviewed by Darin Adler.

The two static hash tables used in this file have 106 and 198 entries. Set a minimumTableSize for
these hash tables so we don't have to expand them during initialization.

No new tests because no functional changes.

* platform/text/LocaleToScriptMappingDefault.cpp:
(WebCore::scriptNameToCode):
(WebCore::localeToScriptCodeForFontSelection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120029> Document::markers() should return a reference

Reviewed by Andreas Kling.

Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
m_markers as const and initialize it in member initialization.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::markers):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::isSpellingMarkerAllowed):
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
(WebCore::AlternativeTextController::handleAlternativeTextUIResult):
(WebCore::AlternativeTextController::respondToChangedSelection):
(WebCore::AlternativeTextController::respondToAppliedEditing):
(WebCore::AlternativeTextController::respondToUnappliedEditing):
(WebCore::AlternativeTextController::markReversed):
(WebCore::AlternativeTextController::markCorrection):
(WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
* editing/DictationCommand.cpp:
(WebCore::DictationMarkerSupplier::addMarkersToTextNode):
* editing/Editor.cpp:
(WebCore::Editor::ignoreSpelling):
(WebCore::Editor::learnSpelling):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::clearMisspellingsAndBadGrammar):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::countMatchesForText):
(WebCore::Editor::setMarkedTextMatchesAreHighlighted):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::selectionStartHasMarkerFor):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheckSucceed):
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply):
(WebCore::SplitTextNodeCommand::doUnapply):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspelling):
(WebCore::TextCheckingHelper::findFirstGrammarDetail):
* page/FrameView.cpp:
(WebCore::FrameView::getTickmarks):
(WebCore::FrameView::paintContents):
* page/Page.cpp:
(WebCore::Page::unmarkAllTextMatches):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::spellingToolTip):
(WebCore::HitTestResult::replacedString):
(WebCore::HitTestResult::dictationAlternatives):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarkers):
* rendering/svg/SVGInlineFlowBox.cpp:
(WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):
(WebCore::Internals::markerAt):
(WebCore::Internals::addTextMatchMarker):

Source/WebKit/blackberry:

* WebKitSupport/InPageSearchManager.cpp:
(BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
(BlackBerry::WebKit::InPageSearchManager::setActiveMatchAndMarker):
(BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
(BlackBerry::WebKit::InputHandler::addAttributedTextMarker):
(BlackBerry::WebKit::InputHandler::removeAttributedTextMarker):

Source/WebKit/efl:

* ewk/ewk_frame.cpp:
(ewk_frame_text_matches_unmark_all):
(ewk_frame_text_matches_nth_pos_get):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _unmarkAllBadGrammar]):
(-[WebFrame _unmarkAllMisspellings]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView unmarkAllTextMatches]):
(-[WebHTMLView rectsForTextMatches]):

Source/WebKit/win:

* WebFrame.cpp:
(WebFrame::unmarkAllMisspellings):
(WebFrame::unmarkAllBadGrammar):
* WebView.cpp:
(WebView::rectsForTextMatches):

Source/WebKit2:

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::rectsForTextMatches):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::unmarkAllMisspellings):
(WebKit::WebPage::unmarkAllBadGrammar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedIntervalLogicalTop()

Reviewed by Alexandru Chiculita.

Source/WebCore:

Completed the implementation of RasterShape::firstIncludedIntervalLogicalTop(). The
method now computes first logical top location where a line segment can be laid
out within a RasterShape, i.e. a shape derived from an image valued URL resource.

A detailed description of the algorithm can be found in
http://hansmuller-webkit.blogspot.com/2013/08/first-fit-location-for-image-shapes.html.

The new tests exposed a bug in the existing getIncludedIntervals() method. A shape
with a vertical gap that spans the entire line now causes the method to short circuit
and return an empty interval list.

Tests: fast/shapes/shape-inside/shape-inside-image-003.html
       fast/shapes/shape-inside/shape-inside-image-004.html
       fast/shapes/shape-inside/shape-inside-image-005.html

* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShapeIntervals::firstIncludedIntervalY):
(WebCore::RasterShapeIntervals::getIncludedIntervals):
(WebCore::RasterShape::firstIncludedIntervalLogicalTop):
* rendering/shapes/RasterShape.h:

LayoutTests:

Verify that the first fit algorithm works correctly for complex image shapes.
For this set of tests the image is specified with an SVG file.

* fast/shapes/resources/svg-shape-001.svg: Added.
* fast/shapes/shape-inside/shape-inside-image-003-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-003.html: Added.
* fast/shapes/shape-inside/shape-inside-image-004-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-004.html: Added.
* fast/shapes/shape-inside/shape-inside-image-005-expected.html: Added.
* fast/shapes/shape-inside/shape-inside-image-005.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after <http://trac.webkit.org/changeset/154260> (https://webkit.org/b/119949);
declare Clipboard::hasData() when building with and without drag support

* dom/Clipboard.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119919> Concurrent JIT crashes in various fast/js/dfg-* tests while the main thread is setting innerHTML

Reviewed by Geoffrey Garen.

More fixes for WriteBarrier deferral during concurrent JIT-ing. This patch makes the use of DesiredWriteBarriers class and the 
initializeLazyWriteBarrierFor* wrapper functions more sane. 

Refactored DesiredWriteBarrier to require an owner, a type, a CodeBlock, and an index. The type indicates how to use the CodeBlock
and index when triggering the WriteBarrier at the end of compilation. 

The client code of initializeLazy* is now responsible for creating the WriteBarrier that will be initialized as well as passing
in the relevant index to be used at the end of compilation. Things were kind of muddled before in that one function did a 
little extra work that really shouldn't have been its responsibility.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addConstant):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGDesiredWriteBarriers.cpp:
(JSC::DFG::DesiredWriteBarrier::DesiredWriteBarrier):
(JSC::DFG::DesiredWriteBarrier::trigger):
* dfg/DFGDesiredWriteBarriers.h:
(JSC::DFG::DesiredWriteBarriers::add):
(JSC::DFG::initializeLazyWriteBarrierForInlineCallFrameExecutable):
(JSC::DFG::initializeLazyWriteBarrierForInlineCallFrameCallee):
(JSC::DFG::initializeLazyWriteBarrierForConstant):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::truncateConstantToInt32):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::constantRegisterForConstant):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark fast/css/giant-stylesheet-crash.html as slow after r154246
since allocating 2GB of RAM takes a long time sometimes.

* TestExpectations:


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