svg/animations/smil-leak-*.svg tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=114280

Approved in person by Geoff Garen.

Increased the number of nodes in the test 10x to see what happens with the number
of leaked nodes.

* svg/animations/smil-leak-dynamically-added-element-instances.svg:
* svg/animations/smil-leak-element-instances-noBaseValRef.svg:
* svg/animations/smil-leak-element-instances.svg:
* svg/animations/smil-leak-elements.svg:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use nullptr instead of 0 in calls to HashMap::add
https://bugs.webkit.org/show_bug.cgi?id=121322

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
(JSC::BytecodeGenerator::addStringConstant):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::cellConstant):

Source/WebCore:

* bridge/IdentifierRep.cpp:
(WebCore::IdentifierRep::get):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::getFontFace):
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::getFontData):
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
* dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationAccumulator::getOrCreate):
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::addCacheWithName):
(WebCore::NodeListsNodeData::addCacheWithQualifiedName):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
* page/PageGroup.cpp:
(WebCore::PageGroup::pageGroup):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::localStorageNamespace):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin):

Source/WebKit2:

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::SyncMessageState::getOrCreate):
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::getOrCreateLocalStorageNamespace):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addBackForwardItem):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::getOrCreate):
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::webPageGroup):

Tools:

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::evaluateScriptInIsolatedWorld):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::evaluateScriptInIsolatedWorld):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG AI assumes that ToThis can never return non-object if it is passed an object, and operationToThis will get the wrong value of isStrictMode() if there's inlining
https://bugs.webkit.org/show_bug.cgi?id=121330

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg and Oliver Hunt.
        
Also print whether a function is strict mode in debug dumps.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpAssumingJITType):
* bytecode/CodeOrigin.cpp:
(JSC::InlineCallFrame::dumpInContext):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

Tools: 

Reviewed by Mark Hahnenberg and Oliver Hunt.

We should run tests even if they don't have expected files yet.
        
* Scripts/run-layout-jsc:

LayoutTests: 

Reviewed by Mark Hahnenberg and Oliver Hunt.

* js/dfg-strict-mode-to-this-expected.txt: Added.
* js/dfg-strict-mode-to-this.html: Added.
* js/jsc-test-list:
* js/script-tests/dfg-strict-mode-to-this.js: Added.
(thingy.bar):
(thingy.foo):
(thingy):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Chrome, DragController and FocusController should hold onto a Page&
https://bugs.webkit.org/show_bug.cgi?id=121325

Reviewed by Anders Carlsson.

* editing/FrameSelection.cpp:
* editing/FrameSelection.h:
* page/Chrome.cpp:
(WebCore::Chrome::Chrome):
(WebCore::Chrome::scroll):
(WebCore::Chrome::createWindow):
(WebCore::canRunModalIfDuringPageDismissal):
(WebCore::Chrome::runBeforeUnloadConfirmPanel):
(WebCore::Chrome::runJavaScriptAlert):
(WebCore::Chrome::runJavaScriptConfirm):
(WebCore::Chrome::runJavaScriptPrompt):
(WebCore::Chrome::mouseDidMoveOverElement):
(WebCore::Chrome::setToolTip):
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/DragController.cpp:
* page/DragController.h:
* page/mac/DragControllerMac.mm:
* page/FocusController.cpp:
* page/FocusController.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/PageGroupLoadDeferrer.cpp:
* page/PageGroupLoadDeferrer.h:
Take references where possible.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http/tests/misc/submit-post-keygen.html is extremely slow on bots, often timing out
https://bugs.webkit.org/show_bug.cgi?id=121331

* platform/mac/TestExpectations: Marked the test as sometimes timing out.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/dom/SVGScriptElement/script-load-and-error-events.svg is flakey
https://bugs.webkit.org/show_bug.cgi?id=25817

Reviewed by Tim Horton.

* svg/dom/SVGScriptElement/script-load-and-error-events.svg: Let test 5 finish
before starting test 6.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid a couple of zero-sized fastMalloc calls
https://bugs.webkit.org/show_bug.cgi?id=121333

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* API/JSStringRefCF.cpp:
(JSStringCopyCFString):
Return an empty constant CFStringRef if the JSStringRef is empty.

* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::JSPropertyNameIterator):
Don't allocate an empty m_jsStrings array if m_jsStringsSize is 0.

Source/WTF:

* wtf/text/StringBuffer.h:
(WTF::StringBuffer::StringBuffer):
Initialize m_data to null if m_length is null, and use Checked<size_t> to check for
overflow when multiplying m_length with the character size.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL JIT broke after r155711
https://bugs.webkit.org/show_bug.cgi?id=121332

Reviewed by Geoffrey Garen.

Fixed OSR entry to use the local variable's index instead of its VirtualRegister.
Initialized ExitArgumentForOperand::m_operand to InvalidVirtualRegister instead of -1.
Fixed compileCallOrConstruct() to update locals on callframe going down.
Fixed prepareOSREntry() to grow stack down if needed.

* ftl/FTLExitArgumentForOperand.h:
(JSC::FTL::ExitArgumentForOperand::ExitArgumentForOperand):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileExtractOSREntryLocal):
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace ScriptState with JSC::ExecState
https://bugs.webkit.org/show_bug.cgi?id=121336

Reviewed by Darin Adler.

* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBObjectStore.h:
* bindings/js/JSInjectedScriptHostCustom.cpp:
* bindings/js/JSInjectedScriptManager.cpp:
* bindings/js/JSNodeCustom.cpp:
* bindings/js/JSNodeFilterCondition.h:
* bindings/js/ScriptController.cpp:
* bindings/js/ScriptDebugServer.cpp:
* bindings/js/ScriptDebugServer.h:
* bindings/js/ScriptEventListener.cpp:
* bindings/js/ScriptEventListener.h:
* bindings/js/ScriptFunctionCall.cpp:
* bindings/js/ScriptFunctionCall.h:
* bindings/js/ScriptObject.cpp:
* bindings/js/ScriptObject.h:
* bindings/js/ScriptProfiler.cpp:
* bindings/js/ScriptProfiler.h:
* bindings/js/ScriptState.cpp:
* bindings/js/ScriptState.h:
* bindings/js/ScriptValue.cpp:
* bindings/js/ScriptValue.h:
* bindings/js/SerializedScriptValue.cpp:
* bindings/js/SerializedScriptValue.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/NodeFilter.cpp:
* dom/NodeFilter.h:
* dom/NodeFilterCondition.cpp:
* dom/NodeFilterCondition.h:
* dom/NodeIterator.cpp:
* dom/NodeIterator.h:
* dom/ScriptExecutionContext.cpp:
* dom/ScriptExecutionContext.h:
* dom/Traversal.cpp:
* dom/Traversal.h:
* dom/TreeWalker.cpp:
* dom/TreeWalker.h:
* inspector/ConsoleMessage.cpp:
* inspector/ConsoleMessage.h:
* inspector/InjectedScript.h:
* inspector/InjectedScriptBase.cpp:
* inspector/InjectedScriptBase.h:
* inspector/InjectedScriptCanvasModule.cpp:
* inspector/InjectedScriptCanvasModule.h:
* inspector/InjectedScriptHost.cpp:
* inspector/InjectedScriptHost.h:
* inspector/InjectedScriptManager.cpp:
* inspector/InjectedScriptManager.h:
* inspector/InjectedScriptModule.cpp:
* inspector/InjectedScriptModule.h:
* inspector/InspectorAgent.cpp:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorConsoleAgent.cpp:
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorConsoleInstrumentation.h:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/PageConsoleAgent.cpp:
* inspector/PageDebuggerAgent.cpp:
* inspector/PageRuntimeAgent.cpp:
* inspector/PageRuntimeAgent.h:
* inspector/ScriptArguments.cpp:
* inspector/ScriptArguments.h:
* inspector/ScriptDebugListener.h:
* inspector/WorkerDebuggerAgent.cpp:
* inspector/WorkerRuntimeAgent.cpp:
* page/Console.cpp:
* page/Console.h:
* page/ContentSecurityPolicy.cpp:
* page/ContentSecurityPolicy.h:
* page/PageConsole.cpp:
* page/PageConsole.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Part 2 of Replace ScriptState with JSC::ExecState
https://bugs.webkit.org/show_bug.cgi?id=121336

* dom/Document.h:
There is no WebCore::JSC namespace!



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
There is no need for any custom bindings for Console
https://bugs.webkit.org/show_bug.cgi?id=121338

Reviewed by Joseph Pecoraro.

* GNUmakefile.list.am:
* Target.pri:
* UseJSC.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove JSConsoleCustom.cpp from project files.

* bindings/js/JSConsoleCustom.cpp:
Removed.

* page/Console.cpp:
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
* page/Console.h:
Swap the order of the arguments to appease the bindings generator.

* page/Console.idl:
Add the [CallWith=ScriptState] attribute to pass the ExecState
and [TreatNullAs=NullString, TreatUndefinedAs=NullString] to get
the right stringification.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename confusingly named "runtimeObject" functions
https://bugs.webkit.org/show_bug.cgi?id=121339

Source/WebCore:

Also CTTE: HTMLElement.

Reviewed by Sam Weinig.

* bindings/js/JSHTMLAppletElementCustom.cpp:
(WebCore::JSHTMLAppletElement::putDelegate): Renamed.
(WebCore::JSHTMLAppletElement::getCallData): Renamed.
* bindings/js/JSHTMLEmbedElementCustom.cpp:
(WebCore::JSHTMLEmbedElement::putDelegate): Renamed.
(WebCore::JSHTMLEmbedElement::getCallData): Renamed.
* bindings/js/JSHTMLObjectElementCustom.cpp:
(WebCore::JSHTMLObjectElement::putDelegate): Renamed.
(WebCore::JSHTMLObjectElement::getCallData): Renamed.

* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::isPluginElement): Changed to take HTMLElement&.
(WebCore::pluginInstance): Ditto.
(WebCore::pluginScriptObjectFromPluginViewBase): Updated for name and type change.
(WebCore::pluginScriptObject): Ditto.
(WebCore::pluginElementPropertyGetter): Ditto.
(WebCore::pluginElementCustomGetOwnPropertySlot): Ditto.
(WebCore::pluginElementCustomPut): Ditto.
(WebCore::pluginElementGetCallData): Ditto.

* bindings/js/JSPluginElementFunctions.h: Updated names and types.

* bindings/objc/WebScriptObject.mm:
(+[WebScriptObject _convertValueToObjcValue:JSC::originRootObject:rootObject:]):
Updated for type change.
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod): Ditto.

Tools:

Reviewed by Sam Weinig.

* Scripts/do-webcore-rename: Updated to do this replace as usual.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a few lingering ScriptStates.

Reviewed by Andy Estes.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::add):
(WebCore::IDBObjectStore::put):
* bindings/cpp/WebNativeNodeFilterCondition.cpp:
(WebNativeNodeFilterCondition::acceptNode):
* bindings/cpp/WebNativeNodeFilterCondition.h:
* dom/CustomElementConstructor.cpp:
(WebCore::CustomElementConstructor::create):
* dom/CustomElementConstructor.h:
* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::registerElement):
* dom/CustomElementRegistry.h:
* plugins/PluginView.cpp:
(WebCore::PluginView::performRequest):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix attempt for WK2 build.

* WebProcess/Plugins/PluginView.cpp: Changed ScriptState to ExecState.
(WebKit::PluginView::performJavaScriptURLRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for EFL port.

* editing/efl/EditorEfl.cpp:
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::write):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSSPropertyAnimation::ensurePropertyMap() is large
https://bugs.webkit.org/show_bug.cgi?id=121199

Reviewed by Darin Adler.

The bug was caused by repeated calls to Vector::append. Avoid it by storing pointers in a local array
and then adding them as we traverse them through to fill m_propertyToIdMap. Also reserve the full
initial capacity at once to avoid repeated calls to FastMalloc and FastFree.

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::instance):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
(WebCore::CSSPropertyAnimationWrapperMap::wrapperForIndex):
(WebCore::CSSPropertyAnimationWrapperMap::indexFromPropertyID):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Renamed from ensurePropertyMap.
Also merged addShorthandProperties into it since they have to access local variables of the other.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r155738.
http://trac.webkit.org/changeset/155738
https://bugs.webkit.org/show_bug.cgi?id=121342

Broke many tests (Requested by ap on #webkit).

* GNUmakefile.list.am:
* Target.pri:
* UseJSC.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSConsoleCustom.cpp: Added.
(WebCore::JSConsole::profile):
(WebCore::JSConsole::profileEnd):
* bindings/js/ScriptState.h:
* page/Console.cpp:
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
* page/Console.h:
* page/Console.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename SpeculativeJIT::integerResult() to int32Result().

Rubber stamped by Mark Hahnenberg.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(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::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::int32Result):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r155719?): http/tests/inspector/network/network-size-chunked.html and
http/tests/inspector/network/network-size-sync.html fail on bots
https://bugs.webkit.org/show_bug.cgi?id=121343

* platform/mac/TestExpectations: Marking these as failing.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Enable Page Visibility API
https://bugs.webkit.org/show_bug.cgi?id=121340

Reviewed by Anders Carlsson.

WebKitLibraries: 

* win/tools/vsprops/FeatureDefines.props: Activate feature.
* win/tools/vsprops/FeatureDefinesCairo.props: Ditto.

LayoutTests: 

* platform/win/TestExpectations: Enable some Page Visibility tests on Windows.


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