Fix broken C loop LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=126024.

Reviewed by Oliver Hunt.

* runtime/VM.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove WKContentViewPrivate.h, WKContentView.h is private now
https://bugs.webkit.org/show_bug.cgi?id=125981

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-19
Reviewed by Dan Bernstein.

There is no need for a separate header, WKContentView has become an implementation
detail of WKView.

* UIProcess/API/ios/WKContentView.h:
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/ios/WKContentViewPrivate.h: Removed.
* UIProcess/API/ios/WKView.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test plugins/destroy-during-npp-new.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=126027

* plugins/destroy-during-npp-new.html: Streamlined the test a little bit to see
what changes, if anything. There should be no effect on what is tested.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement ArrayBuffer.isView
https://bugs.webkit.org/show_bug.cgi?id=126004

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

Test coverage in webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html

* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation): Add 'isView' to object constructor.
(JSC::arrayBufferFuncIsView): New method.

LayoutTests: 

* webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
Correct test for 'isView' to actually check for 'isView' function.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove WebFilterEvaluator wrappers from WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=126028

Reviewed by Anders Carlsson.

Source/WebCore:

It's overkill to pipe access to WebFilterEvaluator through
WebKitSystemInterface. Instead, include WebFilterEvaluator.h when it
exists and re-declare WebFilterEvaluator when it doesn't.

WebKitSystemInterface used to soft-link WebContentAnalysis.framework
since OS X 10.7 didn't contain this framework. Since we no longer
support 10.7, we can now directly link against the framework.

* Configurations/WebCore.xcconfig: Add /System/Library/PrivateHeaders
to the system framework search path at both compile and link time so
that we can find WebContentAnalysis.framework.
* WebCore.exp.in: Don't export removed symbols.
* WebCore.xcodeproj/project.pbxproj: Added WebContentAnalysis.framework
to the 'Link Binary With Libraries' build phase.
* platform/mac/ContentFilterMac.mm: Included WebFilterEvaluator.h when
it exists and re-declared WebFilterEvaluator when it doesn't.
(WebCore::ContentFilter::ContentFilter): Directly called a method on
m_platformContentFilter rather than going through WKSI.
(WebCore::ContentFilter::isEnabled): Ditto.
(WebCore::ContentFilter::addData): Ditto.
(WebCore::ContentFilter::finishedAddingData): Ditto.
(WebCore::ContentFilter::needsMoreData): Ditto.
(WebCore::ContentFilter::didBlockData): Ditto.
* platform/mac/WebCoreSystemInterface.h: Removed function pointers for
calling into WKSI.
* platform/mac/WebCoreSystemInterface.mm: Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Don't INIT() removed function pointers.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Don't INIT() removed function pointers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put write barriers in the right places in the baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=125975

Reviewed by Filip Pizlo.

* jit/JIT.cpp:
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
(JSC::JIT::emitArrayProfilingSite):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_enter):
(JSC::JIT::emitSlow_op_enter):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enter):
(JSC::JIT::emitSlow_op_enter):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitPutGlobalProperty):
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_init_global_const):
(JSC::JIT::checkMarkWord):
(JSC::JIT::emitWriteBarrier):
(JSC::JIT::privateCompilePutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitPutGlobalProperty):
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_init_global_const):
* jit/Repatch.cpp:
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
(JSC::repatchPutByID):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DOM bindings should use thisValue for attributes
https://bugs.webkit.org/show_bug.cgi?id=126011

Reviewed by Antti Koivisto.

Source/WebCore:

Make all standard DOM attributes use the thisValue instead
of the slot object.  This requires using a dynamic cast in
the attribute getters. Happily for normal uses this a single
indirect load and pointer compare, and we were already doing
it for many attributes.

Alas it's too expensive to do this on the window object still
due to the proxy indirection that intercepts global variable
access.  I'll correct this in a follow on patch (bug 126013).

A number of custom getters have also been updated to use the
thisValue and full type checks.

This patch still leaves the index and generic named getters
on the slot based model as fixing these cases requires more
complicated changes.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
(WebCore::cssPropertyGetterCallback):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttr):
(WebCore::jsTestActiveDOMObjectConstructor):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::jsTestEventConstructorAttr1):
(WebCore::jsTestEventConstructorAttr2):
(WebCore::jsTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetConstructor):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::jsTestExceptionName):
(WebCore::jsTestExceptionConstructor):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::jsTestGenerateIsReachableConstructor):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
(WebCore::jsTestInterfaceImplementsStr1):
(WebCore::jsTestInterfaceImplementsStr2):
(WebCore::jsTestInterfaceImplementsStr3):
(WebCore::jsTestInterfaceImplementsNode):
(WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::jsTestInterfaceSupplementalStr1):
(WebCore::jsTestInterfaceSupplementalStr2):
(WebCore::jsTestInterfaceSupplementalStr3):
(WebCore::jsTestInterfaceSupplementalNode):
(WebCore::jsTestInterfaceConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::jsTestMediaQueryListListenerConstructor):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodeConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjReadOnlyLongAttr):
(WebCore::jsTestObjReadOnlyStringAttr):
(WebCore::jsTestObjReadOnlyTestObjAttr):
(WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
(WebCore::jsTestObjConstructorStaticStringAttr):
(WebCore::jsTestObjConstructorTestSubObj):
(WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::jsTestObjEnumAttr):
(WebCore::jsTestObjByteAttr):
(WebCore::jsTestObjOctetAttr):
(WebCore::jsTestObjShortAttr):
(WebCore::jsTestObjUnsignedShortAttr):
(WebCore::jsTestObjLongAttr):
(WebCore::jsTestObjLongLongAttr):
(WebCore::jsTestObjUnsignedLongLongAttr):
(WebCore::jsTestObjStringAttr):
(WebCore::jsTestObjTestObjAttr):
(WebCore::jsTestObjXMLObjAttr):
(WebCore::jsTestObjCreate):
(WebCore::jsTestObjReflectedStringAttr):
(WebCore::jsTestObjReflectedIntegralAttr):
(WebCore::jsTestObjReflectedUnsignedIntegralAttr):
(WebCore::jsTestObjReflectedBooleanAttr):
(WebCore::jsTestObjReflectedURLAttr):
(WebCore::jsTestObjReflectedCustomIntegralAttr):
(WebCore::jsTestObjReflectedCustomBooleanAttr):
(WebCore::jsTestObjReflectedCustomURLAttr):
(WebCore::jsTestObjTypedArrayAttr):
(WebCore::jsTestObjAttrWithGetterException):
(WebCore::jsTestObjAttrWithSetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithSetterException):
(WebCore::jsTestObjCustomAttr):
(WebCore::jsTestObjWithScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::jsTestObjConditionalAttr1):
(WebCore::jsTestObjConditionalAttr2):
(WebCore::jsTestObjConditionalAttr3):
(WebCore::jsTestObjConditionalAttr4Constructor):
(WebCore::jsTestObjConditionalAttr5Constructor):
(WebCore::jsTestObjConditionalAttr6Constructor):
(WebCore::jsTestObjCachedAttribute1):
(WebCore::jsTestObjCachedAttribute2):
(WebCore::jsTestObjAnyAttribute):
(WebCore::jsTestObjContentDocument):
(WebCore::jsTestObjMutablePoint):
(WebCore::jsTestObjImmutablePoint):
(WebCore::jsTestObjStrawberry):
(WebCore::jsTestObjStrictFloat):
(WebCore::jsTestObjDescription):
(WebCore::jsTestObjId):
(WebCore::jsTestObjHash):
(WebCore::jsTestObjReplaceableAttribute):
(WebCore::jsTestObjNullableDoubleAttribute):
(WebCore::jsTestObjNullableLongAttribute):
(WebCore::jsTestObjNullableBooleanAttribute):
(WebCore::jsTestObjNullableStringAttribute):
(WebCore::jsTestObjNullableLongSettableAttribute):
(WebCore::jsTestObjNullableStringValue):
(WebCore::jsTestObjAttribute):
(WebCore::jsTestObjAttributeWithReservedEnumType):
(WebCore::jsTestObjConstructor):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::jsTestSerializedScriptValueInterfaceValue):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
(WebCore::jsTestSerializedScriptValueInterfacePorts):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsUnsignedLongLongAttr):
(WebCore::jsTestTypedefsImmutableSerializedScriptValue):
(WebCore::jsTestTypedefsConstructorTestSubObj):
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsAttrWithSetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsConstructor):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::jsattributeReadonly):
(WebCore::jsattributeConstructor):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::jsreadonlyConstructor):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):

LayoutTests:

* js/dom/dom-attributes-on-mismatch-type.html: Added.
* js/dom/dom-attributes-on-mismatch-type-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin stubbing out the KeyedDecoder class
https://bugs.webkit.org/show_bug.cgi?id=126031

Reviewed by Andreas Kling.

KeyedDecoder is going to be the new way to decode back forward trees.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::decodeBackForwardTree):
* history/HistoryItem.h:
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::~KeyedDecoder):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add an utility class to simplify generating function calls
https://bugs.webkit.org/show_bug.cgi?id=125972

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Split branchTest32 in two functions: test32AndSetFlags and branchOnFlags.
This is done to allow code where the flags are set, multiple operation that
do not modify the flags occur, then the flags are used.

This is used for function calls to test the return value while discarding the
return register.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::test32AndSetFlags):
(JSC::MacroAssemblerX86Common::branchOnFlags):
(JSC::MacroAssemblerX86Common::branchTest32):

Source/WebCore: 

FunctionCall is a little helper class to make function calls from the JIT
in 3 or 4 lines.

FunctionCall takes a StackAllocator, a RegisterAllocator and a function pointer.
When the call is generated, the helper saves the registers as necessary, aligns
the stack, does the call, restores the stack, and restore the registers.

* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):

(WebCore::FunctionCall::callAndBranchOnCondition): Most test functions used
with FunctionCall return a boolean. When the boolean is the sole purpose of the function
call, this provides an easy way to branch on the boolean without worrying about registers.

The return register is tested first, then all the saved registers are restored from the stack
(which can include the return register), finally the flags are used for a jump.

(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):
* WebCore.xcodeproj/project.pbxproj:
* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):
(WebCore::FunctionCall::callAndBranchOnCondition):
(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][iOS] Enable multiprocess by default
https://bugs.webkit.org/show_bug.cgi?id=126030

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-19
Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Add InspectorFrontendHost.debuggableType to let the frontend know it's backend is JavaScript or Web
https://bugs.webkit.org/show_bug.cgi?id=126016

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-12-19
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForDebuggable):
* inspector/remote/RemoteInspectorConstants.h:
Include a debuggable type identifier in the debuggable listing,
so the remote frontend can know if it is debugging a Web Page
or JS Context.

Source/WebCore:

* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::debuggableType):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Expose the debuggableType to the frontend. In WebCore it is always a "web" type.

Source/WebInspectorUI:

* UserInterface/LoadInspectorBackendCommands.js:
If the debuggable target is "web" load both JS and Web backend commands.
Otherwise, we only load the default, js backend commands.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Uncaught Exception: NavigationSidebarPanel.js: TypeError: undefined is not a function
https://bugs.webkit.org/show_bug.cgi?id=126018

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-12-19
Reviewed by Timothy Hatcher.

ERROR: TypeError: undefined is not a function (evaluating 'representedObject.saveIdentityToCookie(candidateObjectCookie)')

There are some TreeElements (Folders, and the special Databases Folder)
which do not have a represented object, and would throw an exception
when trying to use saveIdentityToCookie.

We should always provide a saveIdentityToCookie when possible. So just
blacklist the tree element types we know do not have representedObjects,
and where we don't want to save identity. This will continue to throw
exceptions in the future for tree elements that don't have the save
function implemented, but should.

Note that even if a TreeElement is constructed with a null represented
object, it becomes an empty object (representedObject || {}).

* UserInterface/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie):
(WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
(WebInspector.NavigationSidebarPanel.prototype.treeElementMatchesCookie):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):

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