haikuwebkit/Source/WebCore/domjit/JSDocumentDOMJIT.cpp

202 lines
8.5 KiB
C++
Raw Permalink Normal View History

[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
/*
* Copyright (C) 2016 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "JSDocument.h"
#if ENABLE(JIT)
#include "DOMJITAbstractHeapRepository.h"
#include "DOMJITCheckDOM.h"
#include "DOMJITHelpers.h"
#include "Document.h"
#include "JSDOMWrapper.h"
#include "JSElement.h"
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
#include "JSHTMLElement.h"
Remove WebCore/ForwardingHeaders directory https://bugs.webkit.org/show_bug.cgi?id=182347 Reviewed by Keith Miller. Source/ThirdParty: * gtest/CMakeLists.txt: * gtest/include/gtest/internal/gtest-port.h: Source/WebCore: No new tests. No change in behavior. * CMakeLists.txt: * ForwardingHeaders/bindings/ScriptFunctionCall.h: Removed. * ForwardingHeaders/bindings/ScriptObject.h: Removed. * ForwardingHeaders/bindings/ScriptValue.h: Removed. * ForwardingHeaders/builtins/BuiltinNames.h: Removed. * ForwardingHeaders/builtins/BuiltinUtils.h: Removed. * ForwardingHeaders/builtins/JSCBuiltins.h: Removed. * ForwardingHeaders/bytecode/CodeBlock.h: Removed. * ForwardingHeaders/bytecode/SpeculatedType.h: Removed. * ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Removed. * ForwardingHeaders/debugger/Debugger.h: Removed. * ForwardingHeaders/domjit/DOMJITAbstractHeap.h: Removed. * ForwardingHeaders/domjit/DOMJITEffect.h: Removed. * ForwardingHeaders/domjit/DOMJITGetterSetter.h: Removed. * ForwardingHeaders/domjit/DOMJITHeapRange.h: Removed. * ForwardingHeaders/domjit/DOMJITSignature.h: Removed. * ForwardingHeaders/heap/BlockDirectoryInlines.h: Removed. * ForwardingHeaders/heap/DeleteAllCodeEffort.h: Removed. * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Removed. * ForwardingHeaders/heap/GCActivityCallback.h: Removed. * ForwardingHeaders/heap/GCFinalizationCallback.h: Removed. * ForwardingHeaders/heap/HandleTypes.h: Removed. * ForwardingHeaders/heap/Heap.h: Removed. * ForwardingHeaders/heap/HeapInlines.h: Removed. * ForwardingHeaders/heap/HeapObserver.h: Removed. * ForwardingHeaders/heap/IncrementalSweeper.h: Removed. * ForwardingHeaders/heap/LockDuringMarking.h: Removed. * ForwardingHeaders/heap/MachineStackMarker.h: Removed. * ForwardingHeaders/heap/MarkedBlockInlines.h: Removed. * ForwardingHeaders/heap/MarkingConstraint.h: Removed. * ForwardingHeaders/heap/RunningScope.h: Removed. * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Removed. * ForwardingHeaders/heap/SlotVisitor.h: Removed. * ForwardingHeaders/heap/SlotVisitorInlines.h: Removed. * ForwardingHeaders/heap/Strong.h: Removed. * ForwardingHeaders/heap/StrongInlines.h: Removed. * ForwardingHeaders/heap/SubspaceInlines.h: Removed. * ForwardingHeaders/heap/ThreadLocalCache.h: Removed. * ForwardingHeaders/heap/Weak.h: Removed. * ForwardingHeaders/heap/WeakInlines.h: Removed. * ForwardingHeaders/inspector/ConsoleMessage.h: Removed. * ForwardingHeaders/inspector/ContentSearchUtilities.h: Removed. * ForwardingHeaders/inspector/IdentifiersFactory.h: Removed. * ForwardingHeaders/inspector/InjectedScript.h: Removed. * ForwardingHeaders/inspector/InjectedScriptBase.h: Removed. * ForwardingHeaders/inspector/InjectedScriptHost.h: Removed. * ForwardingHeaders/inspector/InjectedScriptManager.h: Removed. * ForwardingHeaders/inspector/InjectedScriptModule.h: Removed. * ForwardingHeaders/inspector/InspectorAgentBase.h: Removed. * ForwardingHeaders/inspector/InspectorAgentRegistry.h: Removed. * ForwardingHeaders/inspector/InspectorBackendDispatcher.h: Removed. * ForwardingHeaders/inspector/InspectorBackendDispatchers.h: Removed. * ForwardingHeaders/inspector/InspectorEnvironment.h: Removed. * ForwardingHeaders/inspector/InspectorFrontendChannel.h: Removed. * ForwardingHeaders/inspector/InspectorFrontendDispatchers.h: Removed. * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Removed. * ForwardingHeaders/inspector/InspectorProtocolObjects.h: Removed. * ForwardingHeaders/inspector/InspectorProtocolTypes.h: Removed. * ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Removed. * ForwardingHeaders/inspector/ScriptArguments.h: Removed. * ForwardingHeaders/inspector/ScriptBreakpoint.h: Removed. * ForwardingHeaders/inspector/ScriptCallFrame.h: Removed. * ForwardingHeaders/inspector/ScriptCallStack.h: Removed. * ForwardingHeaders/inspector/ScriptCallStackFactory.h: Removed. * ForwardingHeaders/inspector/ScriptDebugListener.h: Removed. * ForwardingHeaders/inspector/ScriptDebugServer.h: Removed. * ForwardingHeaders/inspector/agents/InspectorAgent.h: Removed. * ForwardingHeaders/inspector/agents/InspectorConsoleAgent.h: Removed. * ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Removed. * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Removed. * ForwardingHeaders/inspector/agents/InspectorRuntimeAgent.h: Removed. * ForwardingHeaders/inspector/agents/InspectorScriptProfilerAgent.h: Removed. * ForwardingHeaders/interpreter/CallFrame.h: Removed. * ForwardingHeaders/interpreter/FrameTracers.h: Removed. * ForwardingHeaders/interpreter/ShadowChicken.h: Removed. * ForwardingHeaders/interpreter/StackVisitor.h: Removed. * ForwardingHeaders/jit/JITCode.h: Removed. * ForwardingHeaders/jit/JITMathICForwards.h: Removed. * ForwardingHeaders/jit/Snippet.h: Removed. * ForwardingHeaders/jit/SnippetParams.h: Removed. * ForwardingHeaders/jit/SpillRegistersMode.h: Removed. * ForwardingHeaders/masm/X86Assembler.h: Removed. * ForwardingHeaders/parser/ParserError.h: Removed. * ForwardingHeaders/parser/SourceCode.h: Removed. * ForwardingHeaders/parser/SourceProvider.h: Removed. * ForwardingHeaders/parser/SourceProviderCache.h: Removed. * ForwardingHeaders/profiler/ProfilerDatabase.h: Removed. * ForwardingHeaders/runtime/ArgList.h: Removed. * ForwardingHeaders/runtime/ArrayBuffer.h: Removed. * ForwardingHeaders/runtime/ArrayBufferView.h: Removed. * ForwardingHeaders/runtime/ArrayPrototype.h: Removed. * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed. * ForwardingHeaders/runtime/BooleanObject.h: Removed. * ForwardingHeaders/runtime/CallData.h: Removed. * ForwardingHeaders/runtime/CatchScope.h: Removed. * ForwardingHeaders/runtime/CommonIdentifiers.h: Removed. * ForwardingHeaders/runtime/Completion.h: Removed. * ForwardingHeaders/runtime/ConfigFile.h: Removed. * ForwardingHeaders/runtime/ConsoleClient.h: Removed. * ForwardingHeaders/runtime/ConsoleTypes.h: Removed. * ForwardingHeaders/runtime/ConstructAbility.h: Removed. * ForwardingHeaders/runtime/ConstructData.h: Removed. * ForwardingHeaders/runtime/DataView.h: Removed. * ForwardingHeaders/runtime/DateInstance.h: Removed. * ForwardingHeaders/runtime/Error.h: Removed. * ForwardingHeaders/runtime/ErrorHandlingScope.h: Removed. * ForwardingHeaders/runtime/ErrorInstance.h: Removed. * ForwardingHeaders/runtime/ErrorPrototype.h: Removed. * ForwardingHeaders/runtime/Exception.h: Removed. * ForwardingHeaders/runtime/ExceptionHelpers.h: Removed. * ForwardingHeaders/runtime/Float32Array.h: Removed. * ForwardingHeaders/runtime/Float64Array.h: Removed. * ForwardingHeaders/runtime/FunctionConstructor.h: Removed. * ForwardingHeaders/runtime/FunctionExecutable.h: Removed. * ForwardingHeaders/runtime/FunctionPrototype.h: Removed. * ForwardingHeaders/runtime/HashMapImpl.h: Removed. * ForwardingHeaders/runtime/Identifier.h: Removed. * ForwardingHeaders/runtime/IdentifierInlines.h: Removed. * ForwardingHeaders/runtime/InitializeThreading.h: Removed. * ForwardingHeaders/runtime/Int16Array.h: Removed. * ForwardingHeaders/runtime/Int32Array.h: Removed. * ForwardingHeaders/runtime/Int8Array.h: Removed. * ForwardingHeaders/runtime/InternalFunction.h: Removed. * ForwardingHeaders/runtime/Intrinsic.h: Removed. * ForwardingHeaders/runtime/IterationKind.h: Removed. * ForwardingHeaders/runtime/IteratorOperations.h: Removed. * ForwardingHeaders/runtime/IteratorPrototype.h: Removed. * ForwardingHeaders/runtime/JSAPIValueWrapper.h: Removed. * ForwardingHeaders/runtime/JSArray.h: Removed. * ForwardingHeaders/runtime/JSArrayBuffer.h: Removed. * ForwardingHeaders/runtime/JSArrayBufferView.h: Removed. * ForwardingHeaders/runtime/JSCInlines.h: Removed. * ForwardingHeaders/runtime/JSCJSValue.h: Removed. * ForwardingHeaders/runtime/JSCJSValueInlines.h: Removed. * ForwardingHeaders/runtime/JSCallee.h: Removed. * ForwardingHeaders/runtime/JSCell.h: Removed. * ForwardingHeaders/runtime/JSCellInlines.h: Removed. * ForwardingHeaders/runtime/JSDataView.h: Removed. * ForwardingHeaders/runtime/JSDestructibleObject.h: Removed. * ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Removed. * ForwardingHeaders/runtime/JSExportMacros.h: Removed. * ForwardingHeaders/runtime/JSFunction.h: Removed. * ForwardingHeaders/runtime/JSGlobalObject.h: Removed. * ForwardingHeaders/runtime/JSGlobalObjectInlines.h: Removed. * ForwardingHeaders/runtime/JSInternalPromise.h: Removed. * ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Removed. * ForwardingHeaders/runtime/JSLock.h: Removed. * ForwardingHeaders/runtime/JSMap.h: Removed. * ForwardingHeaders/runtime/JSMapIterator.h: Removed. * ForwardingHeaders/runtime/JSModuleLoader.h: Removed. * ForwardingHeaders/runtime/JSModuleRecord.h: Removed. * ForwardingHeaders/runtime/JSNativeStdFunction.h: Removed. * ForwardingHeaders/runtime/JSONObject.h: Removed. * ForwardingHeaders/runtime/JSObject.h: Removed. * ForwardingHeaders/runtime/JSObjectInlines.h: Removed. * ForwardingHeaders/runtime/JSPromise.h: Removed. * ForwardingHeaders/runtime/JSPromiseConstructor.h: Removed. * ForwardingHeaders/runtime/JSPromiseDeferred.h: Removed. * ForwardingHeaders/runtime/JSProxy.h: Removed. * ForwardingHeaders/runtime/JSRunLoopTimer.h: Removed. * ForwardingHeaders/runtime/JSScriptFetchParameters.h: Removed. * ForwardingHeaders/runtime/JSScriptFetcher.h: Removed. * ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Removed. * ForwardingHeaders/runtime/JSSet.h: Removed. * ForwardingHeaders/runtime/JSSetIterator.h: Removed. * ForwardingHeaders/runtime/JSSourceCode.h: Removed. * ForwardingHeaders/runtime/JSString.h: Removed. * ForwardingHeaders/runtime/JSTypedArrays.h: Removed. * ForwardingHeaders/runtime/JSWithScope.h: Removed. * ForwardingHeaders/runtime/Lookup.h: Removed. * ForwardingHeaders/runtime/MapBase.h: Removed. * ForwardingHeaders/runtime/MapData.h: Removed. * ForwardingHeaders/runtime/MapDataInlines.h: Removed. * ForwardingHeaders/runtime/MatchResult.h: Removed. * ForwardingHeaders/runtime/Microtask.h: Removed. * ForwardingHeaders/runtime/ObjectConstructor.h: Removed. * ForwardingHeaders/runtime/ObjectPrototype.h: Removed. * ForwardingHeaders/runtime/Operations.h: Removed. * ForwardingHeaders/runtime/PrivateName.h: Removed. * ForwardingHeaders/runtime/PromiseDeferredTimer.h: Removed. * ForwardingHeaders/runtime/PropertyNameArray.h: Removed. * ForwardingHeaders/runtime/Protect.h: Removed. * ForwardingHeaders/runtime/RegExp.h: Removed. * ForwardingHeaders/runtime/RegExpObject.h: Removed. * ForwardingHeaders/runtime/RuntimeFlags.h: Removed. * ForwardingHeaders/runtime/SamplingProfiler.h: Removed. * ForwardingHeaders/runtime/ScriptFetchParameters.h: Removed. * ForwardingHeaders/runtime/ScriptFetcher.h: Removed. * ForwardingHeaders/runtime/StringObject.h: Removed. * ForwardingHeaders/runtime/StringPrototype.h: Removed. * ForwardingHeaders/runtime/Structure.h: Removed. * ForwardingHeaders/runtime/StructureChain.h: Removed. * ForwardingHeaders/runtime/StructureInlines.h: Removed. * ForwardingHeaders/runtime/Symbol.h: Removed. * ForwardingHeaders/runtime/SymbolTable.h: Removed. * ForwardingHeaders/runtime/ThrowScope.h: Removed. * ForwardingHeaders/runtime/TypedArrayController.h: Removed. * ForwardingHeaders/runtime/TypedArrayInlines.h: Removed. * ForwardingHeaders/runtime/TypedArrays.h: Removed. * ForwardingHeaders/runtime/Uint16Array.h: Removed. * ForwardingHeaders/runtime/Uint32Array.h: Removed. * ForwardingHeaders/runtime/Uint8Array.h: Removed. * ForwardingHeaders/runtime/Uint8ClampedArray.h: Removed. * ForwardingHeaders/runtime/VM.h: Removed. * ForwardingHeaders/runtime/VMEntryScope.h: Removed. * ForwardingHeaders/runtime/Watchdog.h: Removed. * ForwardingHeaders/runtime/WeakGCMap.h: Removed. * ForwardingHeaders/runtime/WeakGCMapInlines.h: Removed. * ForwardingHeaders/runtime/WriteBarrier.h: Removed. * ForwardingHeaders/wasm/WasmModule.h: Removed. * ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Removed. * ForwardingHeaders/yarr/RegularExpression.h: Removed. * ForwardingHeaders/yarr/Yarr.h: Removed. * ForwardingHeaders/yarr/YarrInterpreter.h: Removed. * ForwardingHeaders/yarr/YarrJIT.h: Removed. * ForwardingHeaders/yarr/YarrPattern.h: Removed. * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: * Modules/encryptedmedia/MediaKeyMessageEvent.h: * Modules/encryptedmedia/MediaKeyMessageEventInit.h: * Modules/encryptedmedia/MediaKeyStatusMap.h: * Modules/encryptedmedia/legacy/LegacyCDM.h: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchRequestInit.h: * Modules/fetch/FetchResponse.h: * Modules/indexeddb/IDBCursor.cpp: * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursorWithValue.cpp: * Modules/indexeddb/IDBDatabase.cpp: * Modules/indexeddb/IDBIndex.cpp: * Modules/indexeddb/IDBKey.cpp: * Modules/indexeddb/IDBKeyRange.cpp: * Modules/indexeddb/IDBObjectStore.cpp: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/client/TransactionOperation.cpp: * Modules/indexeddb/server/MemoryObjectStore.cpp: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: * Modules/mediacontrols/MediaControlsHost.cpp: * Modules/mediasource/SourceBuffer.cpp: * Modules/mediastream/RTCDataChannel.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: * Modules/webaudio/AsyncAudioDecoder.cpp: * Modules/webaudio/AudioBuffer.cpp: * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioContext.cpp: * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/PeriodicWave.h: * Modules/webaudio/RealtimeAnalyser.cpp: * Modules/webaudio/RealtimeAnalyser.h: * Modules/webaudio/ScriptProcessorNode.cpp: * Modules/webaudio/WaveShaperProcessor.h: * Modules/webauthn/AuthenticatorResponse.h: * Modules/webauthn/PublicKeyCredential.h: * Modules/websockets/WebSocket.cpp: * Modules/websockets/WebSocketChannel.cpp: * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: * Modules/webvr/VREyeParameters.h: * Modules/webvr/VRFrameData.h: * Modules/webvr/VRPose.h: * Modules/webvr/VRStageParameters.h: * PlatformWin.cmake: * bindings/IDLTypes.h: * bindings/js/BufferSource.h: * bindings/js/CachedScriptFetcher.h: * bindings/js/CachedScriptSourceProvider.h: * bindings/js/CallTracerTypes.h: * bindings/js/CommonVM.cpp: * bindings/js/DOMGCOutputConstraint.cpp: * bindings/js/DOMGCOutputConstraint.h: * bindings/js/GCController.cpp: * bindings/js/GCController.h: * bindings/js/IDBBindingUtilities.cpp: * bindings/js/JSCallbackData.cpp: * bindings/js/JSCallbackData.h: * bindings/js/JSCustomElementInterface.cpp: * bindings/js/JSCustomElementInterface.h: * bindings/js/JSCustomEventCustom.cpp: * bindings/js/JSCustomXPathNSResolver.cpp: * bindings/js/JSCustomXPathNSResolver.h: * bindings/js/JSDOMBinding.h: * bindings/js/JSDOMBuiltinConstructorBase.cpp: * bindings/js/JSDOMConstructorBase.cpp: * bindings/js/JSDOMConvertBase.h: * bindings/js/JSDOMConvertBufferSource.h: * bindings/js/JSDOMConvertDate.cpp: * bindings/js/JSDOMConvertInterface.h: * bindings/js/JSDOMConvertJSON.h: * bindings/js/JSDOMConvertNumbers.cpp: * bindings/js/JSDOMConvertNumbers.h: * bindings/js/JSDOMConvertObject.h: * bindings/js/JSDOMConvertRecord.h: * bindings/js/JSDOMConvertSequences.h: * bindings/js/JSDOMConvertStrings.cpp: * bindings/js/JSDOMConvertUnion.h: * bindings/js/JSDOMExceptionHandling.cpp: * bindings/js/JSDOMExceptionHandling.h: * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMGuardedObject.h: * bindings/js/JSDOMIterator.cpp: * bindings/js/JSDOMIterator.h: * bindings/js/JSDOMMapLike.cpp: * bindings/js/JSDOMMapLike.h: * bindings/js/JSDOMPromise.cpp: * bindings/js/JSDOMPromise.h: * bindings/js/JSDOMPromiseDeferred.cpp: * bindings/js/JSDOMPromiseDeferred.h: * bindings/js/JSDOMWindowBase.cpp: * bindings/js/JSDOMWindowCustom.cpp: * bindings/js/JSDOMWindowProxy.cpp: * bindings/js/JSDOMWindowProxy.h: * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSDOMWrapper.h: * bindings/js/JSDOMWrapperCache.cpp: * bindings/js/JSDOMWrapperCache.h: * bindings/js/JSDynamicDowncast.h: * bindings/js/JSErrorHandler.cpp: * bindings/js/JSEventCustom.cpp: * bindings/js/JSEventListener.cpp: * bindings/js/JSEventListener.h: * bindings/js/JSHTMLElementCustom.cpp: * bindings/js/JSHistoryCustom.cpp: * bindings/js/JSIDBCursorWithValueCustom.cpp: * bindings/js/JSIDBIndexCustom.cpp: * bindings/js/JSImageDataCustom.cpp: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLocationCustom.cpp: * bindings/js/JSMainThreadExecState.h: * bindings/js/JSMainThreadExecStateInstrumentation.h: * bindings/js/JSMessageChannelCustom.cpp: * bindings/js/JSMessageEventCustom.cpp: * bindings/js/JSNodeIteratorCustom.cpp: * bindings/js/JSPopStateEventCustom.cpp: * bindings/js/JSReadableStreamPrivateConstructors.cpp: * bindings/js/JSTreeWalkerCustom.cpp: * bindings/js/JSWebGL2RenderingContextCustom.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * bindings/js/ScheduledAction.cpp: * bindings/js/ScheduledAction.h: * bindings/js/ScriptCachedFrameData.cpp: * bindings/js/ScriptCachedFrameData.h: * bindings/js/ScriptController.cpp: * bindings/js/ScriptController.h: * bindings/js/ScriptControllerMac.mm: * bindings/js/ScriptModuleLoader.cpp: * bindings/js/ScriptModuleLoader.h: * bindings/js/ScriptSourceCode.h: * bindings/js/ScriptState.cpp: * bindings/js/ScriptWrappable.h: * bindings/js/ScriptWrappableInlines.h: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * bindings/js/StructuredClone.cpp: * bindings/js/WebCoreBuiltinNames.h: * bindings/js/WebCoreJSClientData.cpp: * bindings/js/WebCoreTypedArrayController.cpp: * bindings/js/WebCoreTypedArrayController.h: * bindings/js/WorkerScriptController.cpp: * bindings/js/WorkerScriptController.h: * bridge/NP_jsobject.cpp: * bridge/c/CRuntimeObject.cpp: * bridge/c/c_class.cpp: * bridge/c/c_instance.cpp: * bridge/c/c_runtime.cpp: * bridge/c/c_utility.cpp: * bridge/c/c_utility.h: * bridge/jsc/BridgeJSC.cpp: * bridge/jsc/BridgeJSC.h: * bridge/npruntime.cpp: * bridge/objc/ObjCRuntimeObject.mm: * bridge/objc/WebScriptObject.mm: * bridge/objc/WebScriptObjectPrivate.h: * bridge/objc/objc_instance.mm: * bridge/objc/objc_runtime.h: * bridge/objc/objc_runtime.mm: * bridge/objc/objc_utility.h: * bridge/objc/objc_utility.mm: * bridge/runtime_array.cpp: * bridge/runtime_array.h: * bridge/runtime_method.cpp: * bridge/runtime_method.h: * bridge/runtime_object.cpp: * bridge/runtime_object.h: * bridge/runtime_root.cpp: * bridge/runtime_root.h: * crypto/SubtleCrypto.cpp: * crypto/SubtleCrypto.h: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: * crypto/keys/CryptoRsaKeyAlgorithm.h: * crypto/mac/CryptoKeyRSAMac.cpp: * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: * css/CSSFontFaceSource.h: * css/DOMMatrixReadOnly.cpp: * css/DOMMatrixReadOnly.h: * css/FontFace.cpp: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementRegistry.cpp: * dom/CustomEvent.cpp: * dom/CustomEvent.h: * dom/Document.cpp: * dom/Document.h: * dom/ErrorEvent.cpp: * dom/ErrorEvent.h: * dom/LoadableScript.h: * dom/MessageEvent.cpp: * dom/MessageEvent.h: * dom/ModuleFetchParameters.h: * dom/PopStateEvent.cpp: * dom/PopStateEvent.h: * dom/PromiseRejectionEvent.cpp: * dom/PromiseRejectionEvent.h: * dom/RejectedPromiseTracker.cpp: * dom/RejectedPromiseTracker.h: * dom/ScriptExecutionContext.cpp: * dom/ScriptExecutionContext.h: * dom/TextEncoder.cpp: * dom/TextEncoder.h: * domjit/DOMJITHelpers.h: * domjit/DOMJITIDLTypeFilter.h: * domjit/JSDocumentDOMJIT.cpp: * domjit/JSNodeDOMJIT.cpp: * fileapi/BlobBuilder.cpp: * fileapi/FileReader.cpp: * fileapi/FileReaderLoader.cpp: * fileapi/FileReaderSync.cpp: * html/BaseTextInputType.cpp: * html/EmailInputType.cpp: * html/HTMLAllCollection.cpp: * html/HTMLCanvasElement.cpp: * html/HTMLImageLoader.cpp: * html/HTMLMediaElement.cpp: * html/HTMLPlugInImageElement.cpp: * html/ImageData.cpp: * html/ImageData.h: * html/MediaEncryptedEventInit.h: * html/WebKitMediaKeyError.h: * html/canvas/WebGLAny.h: * html/canvas/WebGLRenderingContext.cpp: * html/canvas/WebGLRenderingContextBase.cpp: * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGPUBuffer.cpp: * html/canvas/WebGPURenderingContext.cpp: * html/canvas/WebGPURenderingContext.h: * html/track/DataCue.cpp: * html/track/DataCue.h: * inspector/CommandLineAPIHost.cpp: * inspector/CommandLineAPIHost.h: * inspector/CommandLineAPIModule.cpp: * inspector/CommandLineAPIModule.h: * inspector/InspectorCanvas.cpp: * inspector/InspectorCanvas.h: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorController.h: * inspector/InspectorDatabaseResource.h: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorInstrumentation.h: * inspector/InspectorOverlay.cpp: * inspector/InspectorOverlay.h: * inspector/InspectorShaderProgram.cpp: * inspector/InspectorShaderProgram.h: * inspector/InspectorStyleSheet.cpp: * inspector/InspectorStyleSheet.h: * inspector/InspectorWebAgentBase.h: * inspector/InstrumentingAgents.h: * inspector/PageScriptDebugServer.cpp: * inspector/PageScriptDebugServer.h: * inspector/TimelineRecordFactory.cpp: * inspector/WebInjectedScriptHost.h: * inspector/WebInjectedScriptManager.h: * inspector/WorkerInspectorController.cpp: * inspector/WorkerInspectorController.h: * inspector/WorkerScriptDebugServer.cpp: * inspector/WorkerScriptDebugServer.h: * inspector/WorkerToPageFrontendChannel.h: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorCSSAgent.cpp: * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorDatabaseAgent.h: * inspector/agents/InspectorIndexedDBAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: * inspector/agents/InspectorMemoryAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorWorkerAgent.h: * inspector/agents/WebConsoleAgent.cpp: * inspector/agents/WebConsoleAgent.h: * inspector/agents/WebDebuggerAgent.h: * inspector/agents/WebHeapAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: * inspector/agents/page/PageRuntimeAgent.h: * inspector/agents/worker/ServiceWorkerAgent.h: * inspector/agents/worker/WorkerDebuggerAgent.cpp: * inspector/agents/worker/WorkerRuntimeAgent.cpp: * inspector/agents/worker/WorkerRuntimeAgent.h: * loader/EmptyClients.cpp: * page/CaptionUserPreferences.cpp: * page/Chrome.cpp: * page/ChromeClient.h: * page/Crypto.cpp: * page/DOMWindow.cpp: * page/DOMWindow.h: * page/Frame.cpp: * page/OriginThreadLocalCache.h: * page/PageConsoleClient.cpp: * page/PageConsoleClient.h: * page/PageDebuggable.cpp: * page/PageGroup.cpp: * page/SettingsBase.h: * page/UserContentController.cpp: * page/cocoa/ResourceUsageThreadCocoa.mm: * page/csp/ContentSecurityPolicy.cpp: * page/ios/FrameIOS.mm: * page/linux/ResourceUsageOverlayLinux.cpp: * page/linux/ResourceUsageThreadLinux.cpp: * platform/MediaSample.h: * platform/SerializedPlatformRepresentation.h: * platform/SharedBuffer.h: * platform/audio/mac/CARingBuffer.h: * platform/cocoa/SharedBufferCocoa.mm: * platform/graphics/ImageBuffer.h: * platform/graphics/LegacyCDMSession.h: * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * platform/graphics/avfoundation/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/ImageBufferDataCG.h: * platform/graphics/cocoa/GPUDeviceMetal.mm: * platform/graphics/filters/FEBlend.cpp: * platform/graphics/filters/FEColorMatrix.cpp: * platform/graphics/filters/FEComponentTransfer.cpp: * platform/graphics/filters/FEComposite.cpp: * platform/graphics/filters/FEConvolveMatrix.cpp: * platform/graphics/filters/FEDisplacementMap.cpp: * platform/graphics/filters/FEDropShadow.cpp: * platform/graphics/filters/FEGaussianBlur.cpp: * platform/graphics/filters/FELighting.h: * platform/graphics/filters/FEMorphology.cpp: * platform/graphics/filters/FETurbulence.cpp: * platform/graphics/filters/FilterEffect.cpp: * platform/graphics/filters/FilterEffect.h: * platform/graphics/gpu/GPUBuffer.h: * platform/graphics/gpu/GPUDevice.h: * platform/graphics/iso/ISOBox.cpp: * platform/graphics/iso/ISOOriginalFormatBox.cpp: * platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp: * platform/graphics/iso/ISOSchemeInformationBox.cpp: * platform/graphics/iso/ISOSchemeTypeBox.cpp: * platform/graphics/iso/ISOTrackEncryptionBox.cpp: * platform/graphics/iso/ISOVTTCue.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/win/ImageBufferDataDirect2D.cpp: * platform/graphics/win/ImageBufferDataDirect2D.h: * platform/ios/wak/WebCoreThread.mm: * platform/mac/SerializedPlatformRepresentationMac.mm: * platform/mac/StringUtilities.mm: * platform/mock/mediasource/MockBox.cpp: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * svg/graphics/SVGImage.cpp: * testing/GCObservation.cpp: * testing/GCObservation.h: * testing/Internals.cpp: * testing/Internals.h: * testing/LegacyMockCDM.cpp: * testing/MockCDMFactory.cpp: * testing/js/WebCoreTestSupport.cpp: * workers/Worker.cpp: * workers/Worker.h: * workers/WorkerConsoleClient.cpp: * workers/WorkerConsoleClient.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerInspectorProxy.cpp: * workers/WorkerMessagingProxy.cpp: * workers/WorkerThread.h: * workers/service/ExtendableEvent.cpp: * workers/service/ServiceWorker.cpp: * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerClient.h: * workers/service/context/ServiceWorkerInspectorProxy.cpp: * workers/service/context/ServiceWorkerThread.cpp: * xml/XMLHttpRequest.cpp: Source/WebKit: * Platform/mac/StringUtilities.mm: * Shared/Cocoa/WebKit2InitializeCocoa.mm: * Shared/WebKit2Initialize.cpp: * Shared/linux/WebMemorySamplerLinux.cpp: * Shared/mac/WebMemorySampler.mac.mm: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: * WebProcess/Plugins/PluginProcessConnection.cpp: * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/cocoa/WebProcessCocoa.mm: Source/WebKitLegacy/ios: * Misc/WebUIKitSupport.mm: Source/WebKitLegacy/mac: * Carbon/CarbonWindowAdapter.mm: * DOM/WebDOMOperations.mm: * History/WebBackForwardList.mm: * History/WebHistoryItem.mm: * Misc/WebCache.mm: * Misc/WebElementDictionary.mm: * Misc/WebIconDatabase.mm: * Misc/WebStringTruncator.mm: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: * Plugins/Hosted/ProxyInstance.mm: * Plugins/Hosted/ProxyRuntimeObject.mm: * Plugins/Hosted/WebHostedNetscapePluginView.mm: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.mm: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebNetscapePluginView.mm: * Plugins/WebPluginController.mm: * WebCoreSupport/WebEditorClient.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: * WebView/WebDataSource.mm: * WebView/WebFrame.mm: * WebView/WebHTMLRepresentation.mm: * WebView/WebHTMLView.mm: * WebView/WebPreferences.mm: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: * WebView/WebTextIterator.mm: * WebView/WebView.mm: * WebView/WebViewData.mm: Source/WebKitLegacy/win: * Plugins/PluginView.cpp: * Plugins/PluginViewWin.cpp: * WebCoreSupport/WebInspectorClient.cpp: * WebCoreSupport/WebInspectorClient.h: * WebFrame.cpp: * WebJavaScriptCollector.cpp: * WebView.cpp: Tools: * WebKitTestRunner/TestController.cpp: Canonical link: https://commits.webkit.org/198358@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-07 05:20:34 +00:00
#include <JavaScriptCore/Snippet.h>
#include <JavaScriptCore/SnippetParams.h>
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
IGNORE_WARNINGS_BEGIN("frame-address");
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
namespace WebCore {
Change WebCore sources to work with unified source builds https://bugs.webkit.org/show_bug.cgi?id=178229 Rubber stamped by Tim Horton. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore: This patch does the following: 1) Move all “using namespace <name>;” into the WebCore namespace (They used to go in the global namespace) and change to "using WebCore::<name>;” in .mm files. 2) Move a bunch of the soft linking library/framework macros out of the .mm files since those caused name collision problems. 3) Fix minor other naming collisions. The problem with 1 in a unified source world is generic names often collide with system header names. For example, WebCore has a Rect class and that collided with a system header type elsewhere. This patch shouldn't change behavior so no new tests. * Configurations/FeatureDefines.xcconfig: * Modules/cache/CacheStorageConnection.cpp: * Modules/cache/DOMCache.cpp: * Modules/cache/DOMCacheStorage.cpp: * Modules/cache/WorkerCacheStorageConnection.cpp: * Modules/encryptedmedia/InitDataRegistry.cpp: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Modules/indexeddb/IDBCursor.cpp: * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/IDBIndex.cpp: * Modules/indexeddb/IDBKeyRange.cpp: * Modules/indexeddb/IDBObjectStore.cpp: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBTransaction.cpp: * Modules/indexeddb/server/MemoryObjectStore.cpp: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setReadyState): (WebCore::toString): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithAVMetadataItemInContext): * Modules/webdriver/NavigatorWebDriver.cpp: * PlatformAppleWin.cmake: * PlatformMac.cmake: * WebCore.xcodeproj/project.pbxproj: * accessibility/ios/AccessibilityObjectIOS.mm: (-[WAKView accessibilityIsIgnored]): Deleted. * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WAKView accessibilityIsIgnored]): * accessibility/win/AXObjectCacheWin.cpp: * bindings/js/CommonVM.cpp: * bindings/js/DOMWrapperWorld.cpp: * bindings/js/GCController.cpp: * bindings/js/IDBBindingUtilities.cpp: * bindings/js/JSAudioTrackCustom.cpp: * bindings/js/JSAudioTrackListCustom.cpp: * bindings/js/JSBlobCustom.cpp: * bindings/js/JSCSSRuleCustom.cpp: * bindings/js/JSCSSRuleListCustom.cpp: * bindings/js/JSCSSStyleDeclarationCustom.cpp: * bindings/js/JSCallbackData.cpp: * bindings/js/JSCanvasRenderingContext2DCustom.cpp: * bindings/js/JSCustomElementInterface.cpp: * bindings/js/JSCustomElementRegistryCustom.cpp: * bindings/js/JSCustomEventCustom.cpp: * bindings/js/JSDOMBindingSecurity.cpp: * bindings/js/JSDOMBuiltinConstructorBase.cpp: * bindings/js/JSDOMConstructorBase.cpp: * bindings/js/JSDOMConstructorWithDocument.cpp: * bindings/js/JSDOMConvertDate.cpp: * bindings/js/JSDOMConvertNumbers.cpp: * bindings/js/JSDOMConvertStrings.cpp: * bindings/js/JSDOMConvertWebGL.cpp: * bindings/js/JSDOMExceptionHandling.cpp: * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMGuardedObject.cpp: * bindings/js/JSDOMPromiseDeferred.cpp: * bindings/js/JSDOMQuadCustom.cpp: * bindings/js/JSDOMWindowBase.cpp: * bindings/js/JSDOMWindowCustom.cpp: * bindings/js/JSDOMWindowProxy.cpp: * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSDOMWrapperCache.cpp: * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: * bindings/js/JSDocumentCustom.cpp: * bindings/js/JSDocumentFragmentCustom.cpp: * bindings/js/JSElementCustom.cpp: * bindings/js/JSErrorHandler.cpp: * bindings/js/JSEventCustom.cpp: * bindings/js/JSEventListener.cpp: * bindings/js/JSEventTargetCustom.cpp: * bindings/js/JSFileSystemEntryCustom.cpp: * bindings/js/JSHTMLCollectionCustom.cpp: * bindings/js/JSHTMLDocumentCustom.cpp: * bindings/js/JSHTMLTemplateElementCustom.cpp: * bindings/js/JSHistoryCustom.cpp: * bindings/js/JSIDBCursorCustom.cpp: * bindings/js/JSIDBCursorWithValueCustom.cpp: * bindings/js/JSIDBIndexCustom.cpp: * bindings/js/JSIDBObjectStoreCustom.cpp: * bindings/js/JSIDBTransactionCustom.cpp: * bindings/js/JSImageDataCustom.cpp: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLocationCustom.cpp: * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: * bindings/js/JSMessageEventCustom.cpp: * bindings/js/JSMessagePortCustom.cpp: * bindings/js/JSMutationObserverCustom.cpp: * bindings/js/JSNodeCustom.cpp: * bindings/js/JSNodeListCustom.cpp: * bindings/js/JSPerformanceEntryCustom.cpp: * bindings/js/JSPluginElementFunctions.cpp: * bindings/js/JSPopStateEventCustom.cpp: * bindings/js/JSReadableStreamPrivateConstructors.cpp: * bindings/js/JSReadableStreamSourceCustom.cpp: * bindings/js/JSSVGPathSegCustom.cpp: * bindings/js/JSTextTrackCueCustom.cpp: * bindings/js/JSTextTrackCustom.cpp: * bindings/js/JSTextTrackListCustom.cpp: * bindings/js/JSTrackCustom.cpp: * bindings/js/JSVideoTrackCustom.cpp: * bindings/js/JSVideoTrackListCustom.cpp: * bindings/js/JSWebGL2RenderingContextCustom.cpp: * bindings/js/JSWebGLRenderingContextCustom.cpp: * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp: * bindings/js/JSWebGPURenderingContextCustom.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkerGlobalScopeCustom.cpp: * bindings/js/JSXMLHttpRequestCustom.cpp: * bindings/js/JSXPathNSResolverCustom.cpp: * bindings/js/ReadableStream.cpp: (WebCore::ReadableStream::pipeTo): (WebCore::ReadableStream::tee): (WebCore::checkReadableStream): (WebCore::callFunction): Deleted. * bindings/js/ScheduledAction.cpp: * bindings/js/ScriptCachedFrameData.cpp: * bindings/js/ScriptController.cpp: * bindings/js/SerializedScriptValue.cpp: * bindings/js/StructuredClone.cpp: * bindings/js/WebCoreJSClientData.cpp: * bindings/js/WorkerScriptController.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementation): (GenerateImplementation): (GenerateDictionaryImplementation): (GenerateCallbackFunctionImplementation): (GenerateCallbackInterfaceImplementation): * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestCallbackFunction.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: * bindings/scripts/test/JS/JSTestStringifier.cpp: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp: * bridge/IdentifierRep.cpp: * bridge/NP_jsobject.cpp: (ObjectMap::get): Deleted. (ObjectMap::add): Deleted. (ObjectMap::remove): Deleted. (objectMap): Deleted. (ObjectMap::RootObjectInvalidationCallback::operator()): Deleted. (getListFromVariantArgs): Deleted. (jsAllocate): Deleted. (jsDeallocate): Deleted. (_NPN_CreateNoScriptObject): Deleted. (_NPN_InvokeDefault): Deleted. (_NPN_Invoke): Deleted. (_NPN_Evaluate): Deleted. (_NPN_GetProperty): Deleted. (_NPN_SetProperty): Deleted. (_NPN_RemoveProperty): Deleted. (_NPN_HasProperty): Deleted. (_NPN_HasMethod): Deleted. (_NPN_SetException): Deleted. (_NPN_Enumerate): Deleted. (_NPN_Construct): Deleted. * bridge/NP_jsobject.h: * contentextensions/ContentExtensionParser.cpp: * crypto/SubtleCrypto.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: (WebCore::CryptoAlgorithmAES_CBC::encrypt): (WebCore::CryptoAlgorithmAES_CBC::decrypt): (WebCore::CryptoAlgorithmAES_CBC::importKey): (WebCore::CryptoAlgorithmAES_CBC::exportKey): * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: (WebCore::CryptoAlgorithmAES_CFB::encrypt): (WebCore::CryptoAlgorithmAES_CFB::decrypt): (WebCore::CryptoAlgorithmAES_CFB::importKey): (WebCore::CryptoAlgorithmAES_CFB::exportKey): * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: (WebCore::parametersAreValid): (WebCore::CryptoAlgorithmAES_CTR::importKey): (WebCore::CryptoAlgorithmAES_CTR::exportKey): * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: (WebCore::tagLengthIsValid): (WebCore::CryptoAlgorithmAES_GCM::encrypt): (WebCore::CryptoAlgorithmAES_GCM::decrypt): (WebCore::CryptoAlgorithmAES_GCM::importKey): (WebCore::CryptoAlgorithmAES_GCM::exportKey): * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: (WebCore::CryptoAlgorithmAES_KW::importKey): (WebCore::CryptoAlgorithmAES_KW::exportKey): * crypto/algorithms/CryptoAlgorithmHMAC.cpp: (WebCore::CryptoAlgorithmHMAC::importKey): (WebCore::CryptoAlgorithmHMAC::exportKey): * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey): * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: (WebCore::CryptoAlgorithmRSA_OAEP::importKey): (WebCore::CryptoAlgorithmRSA_OAEP::exportKey): * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: (WebCore::CryptoAlgorithmRSA_PSS::importKey): (WebCore::CryptoAlgorithmRSA_PSS::exportKey): * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits): (WebCore::commonCryptoHMACAlgorithm): Deleted. * css/CSSBasicShapes.cpp: * css/CSSPrimitiveValue.cpp: * css/parser/CSSParser.cpp: * css/parser/CSSPropertyParser.cpp: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): (WebCore::CSSPropertyParserHelpers::consumePosition): (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted. * dom/DOMQuad.cpp: * dom/Document.cpp: * dom/ErrorEvent.cpp: * dom/EventListenerMap.cpp: * dom/EventTarget.cpp: * dom/PromiseRejectionEvent.cpp: * dom/RejectedPromiseTracker.cpp: * dom/ScriptExecutionContext.cpp: * domjit/JSDocumentDOMJIT.cpp: * domjit/JSDocumentFragmentDOMJIT.cpp: * domjit/JSElementDOMJIT.cpp: * domjit/JSEventDOMJIT.cpp: * domjit/JSNodeDOMJIT.cpp: * editing/TextIterator.cpp: * editing/cocoa/HTMLConverter.mm: * history/CachedPage.cpp: * html/HTMLCanvasElement.cpp: * html/HTMLFontElement.cpp: * html/HTMLMediaElement.cpp: * html/HTMLSelectElement.cpp: * html/TypeAhead.cpp: * html/parser/HTMLSrcsetParser.cpp: (WebCore::tokenizeDescriptors): * html/parser/HTMLTokenizer.cpp: * html/parser/ParsingUtilities.h: (WebCore::isNotASCIISpace): * html/parser/XSSAuditorDelegate.cpp: * html/track/DataCue.cpp: * inspector/CommandLineAPIHost.cpp: * inspector/CommandLineAPIModule.cpp: * inspector/InspectorApplicationCacheAgent.cpp: * inspector/InspectorCSSAgent.cpp: * inspector/InspectorCanvas.cpp: * inspector/InspectorCanvasAgent.cpp: * inspector/InspectorClient.cpp: * inspector/InspectorController.cpp: * inspector/InspectorDOMAgent.cpp: * inspector/InspectorDOMDebuggerAgent.cpp: * inspector/InspectorDOMStorageAgent.cpp: * inspector/InspectorDatabaseAgent.cpp: * inspector/InspectorDatabaseResource.cpp: * inspector/InspectorFrontendClientLocal.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/InspectorIndexedDBAgent.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/InspectorLayerTreeAgent.cpp: * inspector/InspectorMemoryAgent.cpp: * inspector/InspectorNetworkAgent.cpp: * inspector/InspectorOverlay.cpp: * inspector/InspectorPageAgent.cpp: * inspector/InspectorShaderProgram.cpp: * inspector/InspectorStyleSheet.cpp: * inspector/InspectorTimelineAgent.cpp: * inspector/InspectorWorkerAgent.cpp: * inspector/InstrumentingAgents.cpp: * inspector/NetworkResourcesData.cpp: * inspector/PageConsoleAgent.cpp: * inspector/PageDebuggerAgent.cpp: * inspector/PageHeapAgent.cpp: * inspector/PageRuntimeAgent.cpp: * inspector/PageScriptDebugServer.cpp: * inspector/TimelineRecordFactory.cpp: * inspector/WebConsoleAgent.cpp: * inspector/WebDebuggerAgent.cpp: * inspector/WebHeapAgent.cpp: * inspector/WebInjectedScriptHost.cpp: * inspector/WebInjectedScriptManager.cpp: * inspector/WorkerConsoleAgent.cpp: * inspector/WorkerDebuggerAgent.cpp: * inspector/WorkerInspectorController.cpp: * inspector/WorkerRuntimeAgent.cpp: * inspector/WorkerScriptDebugServer.cpp: * loader/FTPDirectoryParser.cpp: * loader/TextResourceDecoder.cpp: * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.cpp: * page/ContextMenuController.cpp: * page/DOMWindow.cpp: * page/Navigator.cpp: * page/PageConsoleClient.cpp: * page/PageDebuggable.cpp: * page/cocoa/ResourceUsageOverlayCocoa.mm: * page/csp/ContentSecurityPolicy.cpp: * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::isNotASCIISpace): Deleted. * page/csp/ContentSecurityPolicyMediaListDirective.cpp: (WebCore::isNotASCIISpace): Deleted. * page/scrolling/ios/ScrollingTreeIOS.cpp: * page/scrolling/ios/ScrollingTreeIOS.h: * page/scrolling/mac/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): (WebCore::operator*): Deleted. * page/scrolling/mac/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): (WebCore::operator*): Deleted. * platform/Length.cpp: * platform/URL.cpp: (WebCore::isSchemeFirstChar): (WebCore::isSchemeChar): (WebCore::isBadChar): (WebCore::isTabNewline): * platform/audio/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pushSamples): * platform/cf/CoreMediaSoftLink.cpp: Removed. * platform/cf/CoreMediaSoftLink.h: Removed. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: * platform/graphics/FloatPolygon.cpp: (WebCore::areCollinearPoints): (WebCore::FloatPolygon::FloatPolygon): (WebCore::VertexPair::intersection const): (WebCore::determinant): Deleted. * platform/graphics/FontCache.cpp: * platform/graphics/FontCascade.cpp: * platform/graphics/GraphicsContext3DPrivate.cpp: * platform/graphics/WidthIterator.cpp: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::process): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: (WebCore::assetTrackMeetsHardwareDecodeRequirements): * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::readSampleMetadata): (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: * platform/graphics/cairo/GraphicsContextCairo.cpp: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): (WebCore::releaseImageData): Deleted. * platform/graphics/cg/ImageBufferDataCG.h: * platform/graphics/cocoa/WebCoreDecompressionSession.mm: * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/opentype/OpenTypeMathData.cpp: * platform/graphics/opentype/OpenTypeVerticalData.cpp: * platform/graphics/transforms/MatrixTransformOperation.cpp: (WebCore::MatrixTransformOperation::blend): (WebCore::createOperation): Deleted. * platform/graphics/win/FontPlatformDataCairoWin.cpp: * platform/graphics/win/FontWin.cpp: * platform/graphics/win/GraphicsContextCGWin.cpp: * platform/graphics/win/GraphicsContextCairoWin.cpp: * platform/graphics/win/GraphicsContextDirect2D.cpp: * platform/graphics/win/GraphicsContextWin.cpp: * platform/graphics/win/UniscribeController.cpp: * platform/image-decoders/ScalableImageDecoder.cpp: (): Deleted. * platform/ios/LegacyTileLayer.mm: (-[LegacyTileHostLayer renderInContext:]): * platform/ios/PlaybackSessionInterfaceAVKit.mm: * platform/ios/ScrollAnimatorIOS.mm: * platform/ios/VideoFullscreenInterfaceAVKit.mm: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController skipBackwardThirtySeconds:]): (-[WebAVPlayerController gotoEndOfSeekableRanges:]): (-[WebAVPlayerController canSeekToBeginning]): (-[WebAVPlayerController canSeekToEnd]): (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]): (-[WebAVPlayerController updateMinMaxTiming]): * platform/ios/WebEvent.mm: * platform/ios/WebItemProviderPasteboard.mm: * platform/ios/wak/WKContentObservation.cpp: * platform/mac/KeyEventMac.mm: * platform/mac/PlaybackSessionInterfaceMac.mm: (WebCore::timeRangesToArray): * platform/mac/ScrollAnimatorMac.mm: (macScrollbarTheme): Deleted. (scrollerImpForScrollbar): Deleted. * platform/mac/ScrollbarThemeMac.mm: (WebCore::scrollbarMap): * platform/mac/VideoFullscreenInterfaceMac.mm: * platform/mac/WebCoreFullScreenPlaceholderView.mm: * platform/mac/WebCoreNSURLExtras.mm: (WebCore::dataForURLComponentType): * platform/mac/WebPlaybackControlsManager.mm: * platform/mac/WebVideoFullscreenController.mm: (SOFT_LINK_CLASS): Deleted. * platform/mac/WebVideoFullscreenHUDWindowController.mm: * platform/mac/WebWindowAnimation.mm: (WebWindowAnimationDurationFromDuration): Deleted. (scaledRect): Deleted. (squaredDistance): Deleted. * platform/mediastream/RealtimeOutgoingVideoSource.cpp: * platform/mediastream/mac/AVCaptureDeviceManager.mm: * platform/mediastream/mac/AVMediaCaptureSource.mm: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::applyFrameRate): (WebCore::AVVideoCaptureSource::processNewFrame): * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: * platform/network/HTTPParsers.cpp: * platform/text/LocaleICU.cpp: * platform/text/TextCodecLatin1.cpp: * platform/text/TextCodecUTF8.cpp: * platform/text/TextEncodingRegistry.cpp: * platform/text/win/LocaleWin.cpp: * platform/win/BString.cpp: * platform/win/KeyEventWin.cpp: * platform/win/ScrollbarThemeWin.cpp: * rendering/BidiRun.cpp: * rendering/FloatingObjects.cpp: * rendering/RenderBlock.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderQuote.cpp: * rendering/RenderText.cpp: * rendering/RenderThemeWin.cpp: * testing/Internals.cpp: * testing/js/WebCoreTestSupport.cpp: * workers/WorkerConsoleClient.cpp: * workers/WorkerGlobalScope.cpp: * workers/WorkerInspectorProxy.cpp: * xml/SoftLinkLibxslt.cpp: Added. * xml/SoftLinkLibxslt.h: Added. * xml/XPathGrammar.cpp: * xml/XPathParser.cpp: * xml/XSLStyleSheetLibxslt.cpp: * xml/XSLTExtensions.cpp: * xml/XSLTProcessorLibxslt.cpp: * xml/XSLTUnicodeSort.cpp: (xsltTransformErrorTrampoline): (WebCore::xsltUnicodeSortFunction): * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::updateLeafTextNode): (WebCore::toString): Deleted. Source/WebCore/PAL: Move soft linking code from WebCore to PAL. * Configurations/FeatureDefines.xcconfig: * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/spi/cocoa/NSAttributedStringSPI.h: Source/WebKit: * Configurations/FeatureDefines.xcconfig: Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: Source/WTF: * wtf/Platform.h: * wtf/cocoa/SoftLinking.h: Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Canonical link: https://commits.webkit.org/194602@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-17 07:10:58 +00:00
using namespace JSC;
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
[DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit https://bugs.webkit.org/show_bug.cgi?id=172260 Reviewed by Filip Pizlo. Source/JavaScriptCore: DOMJIT::Patchpoint is now used for generalized CheckSubClass. And it becomes mature enough to be used as a general-purpose injectable compiler over all the JIT tiers. We extract DOMJIT::Patchpoint to jit/ and rename it JSC::Snippet. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCaseSnippetParams.cpp: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.cpp. (JSC::SlowPathCallGeneratorWithArguments::generateImpl): (JSC::AccessCaseSnippetParams::emitSlowPathCalls): * bytecode/AccessCaseSnippetParams.h: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.h. (JSC::AccessCaseSnippetParams::AccessCaseSnippetParams): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::emitDOMJITGetter): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: * dfg/DFGNode.h: * dfg/DFGSnippetParams.cpp: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp. * dfg/DFGSnippetParams.h: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.h. (JSC::DFG::SnippetParams::SnippetParams): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::allocateTemporaryRegistersForSnippet): (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): (JSC::DFG::SpeculativeJIT::compileCheckSubClass): (JSC::DFG::allocateTemporaryRegistersForPatchpoint): Deleted. * domjit/DOMJITCallDOMGetterSnippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITCallDOMGetterPatchpoint.h. (JSC::DOMJIT::CallDOMGetterSnippet::create): * domjit/DOMJITGetterSetter.h: * domjit/DOMJITSignature.h: * domjit/DOMJITValue.h: Removed. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * ftl/FTLSnippetParams.cpp: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp. * ftl/FTLSnippetParams.h: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h. (JSC::FTL::SnippetParams::SnippetParams): * jit/Snippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpoint.h. (JSC::Snippet::create): (JSC::Snippet::setGenerator): (JSC::Snippet::generator): * jit/SnippetParams.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h. (JSC::SnippetParams::~SnippetParams): (JSC::SnippetParams::Value::Value): (JSC::SnippetParams::Value::isGPR): (JSC::SnippetParams::Value::isFPR): (JSC::SnippetParams::Value::isJSValueRegs): (JSC::SnippetParams::Value::gpr): (JSC::SnippetParams::Value::fpr): (JSC::SnippetParams::Value::jsValueRegs): (JSC::SnippetParams::Value::reg): (JSC::SnippetParams::Value::value): (JSC::SnippetParams::SnippetParams): * jit/SnippetReg.h: Renamed from Source/JavaScriptCore/domjit/DOMJITReg.h. (JSC::SnippetReg::SnippetReg): * jit/SnippetSlowPathCalls.h: Renamed from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h. * jsc.cpp: (WTF::DOMJITNode::checkSubClassSnippet): (WTF::DOMJITFunctionObject::checkSubClassSnippet): (WTF::DOMJITNode::checkSubClassPatchpoint): Deleted. (WTF::DOMJITFunctionObject::checkSubClassPatchpoint): Deleted. * runtime/ClassInfo.h: Source/WebCore: * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h. * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/test/JS/JSTestDOMJIT.h: * domjit/DOMJITCheckDOM.h: (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapper): * domjit/JSDocumentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocument): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): (WebCore::DocumentBodyDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSDocument): Deleted. * domjit/JSDocumentFragmentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocumentFragment): (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted. * domjit/JSElementDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSElement): (WebCore::checkSubClassPatchpointForJSElement): Deleted. * domjit/JSEventDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSEvent): (WebCore::checkSubClassPatchpointForJSEvent): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSNode): (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): (WebCore::NodeLastChildDOMJIT::callDOMGetter): (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): (WebCore::NodeParentNodeDOMJIT::callDOMGetter): (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSNode): Deleted. Canonical link: https://commits.webkit.org/189575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-27 19:03:41 +00:00
Ref<JSC::Snippet> checkSubClassSnippetForJSDocument()
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
{
return DOMJIT::checkDOM<Document>();
}
Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=171637 Reviewed by Darin Adler. JSTests: * stress/domjit-getter-complex-with-incorrect-object.js: (i.shouldThrow): * stress/domjit-getter-type-check.js: Copied from JSTests/stress/domjit-getter-complex-with-incorrect-object.js. (shouldBe): (i.shouldThrow): Source/JavaScriptCore: Each DOM attribute getter has the code to perform ClassInfo check. But it is largely duplicate and causes code bloating. In this patch, we move ClassInfo check from WebCore to JSC and reduce code size. We introduce DOMAnnotation which has ClassInfo* and DOMJIT::GetterSetter*. If the getter is not DOMJIT getter, this DOMJIT::GetterSetter becomes nullptr. We support such a CustomAccessorGetter in all the JIT tiers. In IC, we drop CheckSubClass completely since IC's Structure check subsumes it. We do not enable this optimization for op_get_by_id_with_this case yet. In DFG and FTL, we emit CheckSubClass node. Which is typically removed by CheckStructure leading to CheckSubClass. And we add DOMAttributeGetterSetter, which is derived class of CustomGetterSetter. It holds DOMAnnotation and perform ClassInfo check. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCase.cpp: (JSC::AccessCase::generateImpl): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback): * bytecode/GetByIdVariant.cpp: (JSC::GetByIdVariant::GetByIdVariant): (JSC::GetByIdVariant::operator=): (JSC::GetByIdVariant::attemptToMerge): (JSC::GetByIdVariant::dumpInContext): * bytecode/GetByIdVariant.h: (JSC::GetByIdVariant::customAccessorGetter): (JSC::GetByIdVariant::domAttribute): (JSC::GetByIdVariant::domJIT): Deleted. * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::create): (JSC::GetterSetterAccessCase::GetterSetterAccessCase): (JSC::GetterSetterAccessCase::emitDOMJITGetter): * bytecode/GetterSetterAccessCase.h: (JSC::GetterSetterAccessCase::domAttribute): (JSC::GetterSetterAccessCase::customAccessor): (JSC::GetterSetterAccessCase::domJIT): Deleted. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::instantiateLexicalVariables): * create_hash_table: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): (JSC::DFG::ByteCodeParser::handleGetById): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGNode.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::callCustomGetter): * domjit/DOMJITGetterSetter.h: (JSC::DOMJIT::GetterSetter::GetterSetter): (JSC::DOMJIT::GetterSetter::getter): (JSC::DOMJIT::GetterSetter::compiler): (JSC::DOMJIT::GetterSetter::resultType): (JSC::DOMJIT::GetterSetter::~GetterSetter): Deleted. (JSC::DOMJIT::GetterSetter::setter): Deleted. (JSC::DOMJIT::GetterSetter::thisClassInfo): Deleted. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * jit/Repatch.cpp: (JSC::tryCacheGetByID): * jsc.cpp: (WTF::DOMJITGetter::DOMJITAttribute::DOMJITAttribute): (WTF::DOMJITGetter::DOMJITAttribute::callDOMGetter): (WTF::DOMJITGetter::customGetter): (WTF::DOMJITGetter::finishCreation): (WTF::DOMJITGetterComplex::DOMJITAttribute::DOMJITAttribute): (WTF::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter): (WTF::DOMJITGetterComplex::customGetter): (WTF::DOMJITGetterComplex::finishCreation): (WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted. (WTF::DOMJITGetter::DOMJITNodeDOMJIT::slowCall): Deleted. (WTF::DOMJITGetter::domJITNodeGetterSetter): Deleted. (WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted. (WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::slowCall): Deleted. (WTF::DOMJITGetterComplex::domJITNodeGetterSetter): Deleted. * runtime/CustomGetterSetter.h: (JSC::CustomGetterSetter::create): (JSC::CustomGetterSetter::setter): (JSC::CustomGetterSetter::CustomGetterSetter): (): Deleted. * runtime/DOMAnnotation.h: Added. (JSC::operator==): (JSC::operator!=): * runtime/DOMAttributeGetterSetter.cpp: Added. * runtime/DOMAttributeGetterSetter.h: Copied from Source/JavaScriptCore/runtime/CustomGetterSetter.h. (JSC::isDOMAttributeGetterSetter): * runtime/Error.cpp: (JSC::throwDOMAttributeGetterTypeError): * runtime/Error.h: (JSC::throwVMDOMAttributeGetterTypeError): * runtime/JSCustomGetterSetterFunction.cpp: (JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall): * runtime/JSObject.cpp: (JSC::JSObject::putInlineSlow): (JSC::JSObject::deleteProperty): (JSC::JSObject::getOwnStaticPropertySlot): (JSC::JSObject::reifyAllStaticProperties): (JSC::JSObject::fillGetterPropertySlot): (JSC::JSObject::findPropertyHashEntry): Deleted. * runtime/JSObject.h: (JSC::JSObject::getOwnNonIndexPropertySlot): (JSC::JSObject::fillCustomGetterPropertySlot): * runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot): * runtime/Lookup.h: (JSC::HashTableValue::domJIT): (JSC::getStaticPropertySlotFromTable): (JSC::putEntry): (JSC::lookupPut): (JSC::reifyStaticProperty): (JSC::reifyStaticProperties): Each static property table has a new field ClassInfo*. It indicates that which ClassInfo check DOMAttribute registered in this static property table requires. * runtime/ProgramExecutable.cpp: (JSC::ProgramExecutable::initializeGlobalProperties): * runtime/PropertyName.h: * runtime/PropertySlot.cpp: (JSC::PropertySlot::customGetter): (JSC::PropertySlot::customAccessorGetter): * runtime/PropertySlot.h: (JSC::PropertySlot::domAttribute): (JSC::PropertySlot::setCustom): (JSC::PropertySlot::setCacheableCustom): (JSC::PropertySlot::getValue): (JSC::PropertySlot::domJIT): Deleted. * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: Source/WebCore: We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side. So, we can drop ClassInfo check from the actual function. We also simplify DOMJIT::GetterSetter to make it smaller size. WebCore size comparison Before: 48443292 After: 48087800 (0.7% reduction) Speedometer Scores show 0.8% improvement. Before: 158.9 +- 0.46 After: 160.2 +- 0.36 Dromaeo DOM core Scores show 5.8% improvement. Before After Total Score: 8424.12runs/s ±1.38% 8911.60runs/s ±1.47% DOM Attributes 12627.27runs/s ±1.87% 14023.17runs/s ±1.87% DOM Modification 1207.82runs/s ±2.48% 1204.21runs/s ±3.05% DOM Query 68068.82runs/s ±0.63% 74273.38runs/s ±0.69% DOM Traversal 1240.07runs/s ±1.96% 1256.64runs/s ±1.77% Performance improvement can be explained by the following optimizations. 1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can drop type checks since get_by_id operation already performs a structure check which subsumes this type check. 2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast. * bindings/scripts/CodeGeneratorJS.pm: (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeGetterDefinition): (GenerateCallbackImplementationContent): (GenerateHashTableValueArray): (GenerateHashTable): (GenerateConstructorHelperMethods): Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size. * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceNamePrototype::finishCreation): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectPrototype::finishCreation): (WebCore::jsTestActiveDOMObjectExcitingAttr): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactionsPrototype::finishCreation): (WebCore::jsTestCEReactionsAttributeWithCEReactions): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions): (WebCore::jsTestCEReactionsStringifierAttribute): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation): (WebCore::jsTestCEReactionsStringifierValue): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerPrototype::finishCreation): (WebCore::jsTestCallTracerTestAttributeInterface): (WebCore::jsTestCallTracerTestAttributeSpecified): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJITPrototype::finishCreation): (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted. (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted. (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted. (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted. (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted. (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted. (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted. (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted. (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted. (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted. (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted. (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted. (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted. (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted. (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted. (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted. (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted. (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted. (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted. (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted. (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted. (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted. (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted. (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted. (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted. (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted. * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorPrototype::finishCreation): (WebCore::jsTestEventConstructorAttr1): (WebCore::jsTestEventConstructorAttr2): (WebCore::jsTestEventConstructorAttr3): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTargetPrototype::finishCreation): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestExceptionPrototype::finishCreation): (WebCore::jsTestExceptionName): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): (WebCore::jsTestGenerateIsReachableASecretAttribute): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttribute): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::initializeProperties): (WebCore::JSTestInterfacePrototype::finishCreation): (WebCore::jsTestInterfaceImplementsStr1): (WebCore::jsTestInterfaceImplementsStr2): (WebCore::jsTestInterfaceImplementsStr3): (WebCore::jsTestInterfaceImplementsNode): (WebCore::jsTestInterfaceSupplementalStr1): (WebCore::jsTestInterfaceSupplementalStr2): (WebCore::jsTestInterfaceSupplementalStr3): (WebCore::jsTestInterfaceSupplementalNode): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation): (WebCore::jsTestInterfaceLeadingUnderscoreReadonly): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterablePrototype::finishCreation): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::finishCreation): (WebCore::jsTestNodeName): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::initializeProperties): (WebCore::JSTestObjPrototype::finishCreation): (WebCore::jsTestObjReadOnlyLongAttr): (WebCore::jsTestObjReadOnlyStringAttr): (WebCore::jsTestObjReadOnlyTestObjAttr): (WebCore::jsTestObjEnumAttr): (WebCore::jsTestObjByteAttr): (WebCore::jsTestObjOctetAttr): (WebCore::jsTestObjShortAttr): (WebCore::jsTestObjClampedShortAttr): (WebCore::jsTestObjEnforceRangeShortAttr): (WebCore::jsTestObjUnsignedShortAttr): (WebCore::jsTestObjLongAttr): (WebCore::jsTestObjLongLongAttr): (WebCore::jsTestObjUnsignedLongLongAttr): (WebCore::jsTestObjStringAttr): (WebCore::jsTestObjUsvstringAttr): (WebCore::jsTestObjTestObjAttr): (WebCore::jsTestObjTestNullableObjAttr): (WebCore::jsTestObjUnforgeableAttr): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjStringLongRecordAttr): (WebCore::jsTestObjUsvstringLongRecordAttr): (WebCore::jsTestObjStringObjRecordAttr): (WebCore::jsTestObjStringNullableObjRecordAttr): (WebCore::jsTestObjDictionaryAttr): (WebCore::jsTestObjNullableDictionaryAttr): (WebCore::jsTestObjAnnotatedTypeInUnionAttr): (WebCore::jsTestObjAnnotatedTypeInSequenceAttr): (WebCore::jsTestObjImplementationEnumAttr): (WebCore::jsTestObjXMLObjAttr): (WebCore::jsTestObjCreate): (WebCore::jsTestObjReflectedStringAttr): (WebCore::jsTestObjReflectedUSVStringAttr): (WebCore::jsTestObjReflectedIntegralAttr): (WebCore::jsTestObjReflectedUnsignedIntegralAttr): (WebCore::jsTestObjReflectedBooleanAttr): (WebCore::jsTestObjReflectedURLAttr): (WebCore::jsTestObjReflectedUSVURLAttr): (WebCore::jsTestObjReflectedCustomIntegralAttr): (WebCore::jsTestObjReflectedCustomBooleanAttr): (WebCore::jsTestObjReflectedCustomURLAttr): (WebCore::jsTestObjEnabledAtRuntimeAttribute): (WebCore::jsTestObjEnabledBySettingAttribute): (WebCore::jsTestObjTypedArrayAttr): (WebCore::jsTestObjAttributeWithGetterException): (WebCore::jsTestObjAttributeWithSetterException): (WebCore::jsTestObjStringAttrWithGetterException): (WebCore::jsTestObjStringAttrWithSetterException): (WebCore::jsTestObjCustomAttr): (WebCore::jsTestObjOnfoo): (WebCore::jsTestObjOnwebkitfoo): (WebCore::jsTestObjWithScriptStateAttribute): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::jsTestObjWithScriptExecutionContextAttribute): (WebCore::jsTestObjWithScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): (WebCore::jsTestObjConditionalAttr1): (WebCore::jsTestObjConditionalAttr2): (WebCore::jsTestObjConditionalAttr3): (WebCore::jsTestObjCachedAttribute1): (WebCore::jsTestObjCachedAttribute2): (WebCore::jsTestObjAnyAttribute): (WebCore::jsTestObjObjectAttribute): (WebCore::jsTestObjContentDocument): (WebCore::jsTestObjMutablePoint): (WebCore::jsTestObjStrawberry): (WebCore::jsTestObjDescription): (WebCore::jsTestObjId): (WebCore::jsTestObjHash): (WebCore::jsTestObjReplaceableAttribute): (WebCore::jsTestObjNullableDoubleAttribute): (WebCore::jsTestObjNullableLongAttribute): (WebCore::jsTestObjNullableBooleanAttribute): (WebCore::jsTestObjNullableStringAttribute): (WebCore::jsTestObjNullableLongSettableAttribute): (WebCore::jsTestObjNullableStringSettableAttribute): (WebCore::jsTestObjNullableUSVStringSettableAttribute): (WebCore::jsTestObjNullableByteStringSettableAttribute): (WebCore::jsTestObjNullableStringValue): (WebCore::jsTestObjAttribute): (WebCore::jsTestObjAttributeWithReservedEnumType): (WebCore::jsTestObjPutForwardsAttribute): (WebCore::jsTestObjPutForwardsNullableAttribute): (WebCore::jsTestObjStringifierAttribute): (WebCore::jsTestObjConditionallyReadWriteAttribute): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterfacePrototype::finishCreation): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation): (WebCore::jsTestPromiseRejectionEventReason): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerializationPrototype::finishCreation): (WebCore::jsTestSerializationFirstStringAttribute): (WebCore::jsTestSerializationSecondLongAttribute): (WebCore::jsTestSerializationThirdUnserializableAttribute): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute): (WebCore::jsTestSerializationFifthLongAttribute): (WebCore::jsTestSerializationSixthTypedefAttribute): (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute): (WebCore::jsTestSerializationEighthIndirectlyAttribute): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInheritPrototype::finishCreation): (WebCore::jsTestSerializationInheritInheritLongAttribute): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue): (WebCore::jsTestSerializedScriptValueInterfaceCachedValue): (WebCore::jsTestSerializedScriptValueInterfacePorts): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadOnlyAttributeIdentifier): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadWriteAttributeIdentifier): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::initializeProperties): (WebCore::JSTestTypedefsPrototype::finishCreation): (WebCore::jsTestTypedefsUnsignedLongLongAttr): (WebCore::jsTestTypedefsSerializedScriptValue): (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsAttrWithGetterException): (WebCore::jsTestTypedefsAttrWithSetterException): (WebCore::jsTestTypedefsStringAttrWithGetterException): (WebCore::jsTestTypedefsStringAttrWithSetterException): (WebCore::jsTestTypedefsBufferSourceAttr): (WebCore::jsTestTypedefsDomTimeStampAttr): They are binding test rebaselines. * domjit/DOMJITIDLTypeFilter.h: * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentDocumentElementAttribute): (WebCore::compileDocumentBodyAttribute): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted. (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::compileNodeFirstChildAttribute): (WebCore::compileNodeLastChildAttribute): (WebCore::compileNodeNextSiblingAttribute): (WebCore::compileNodePreviousSiblingAttribute): (WebCore::compileNodeParentNodeAttribute): (WebCore::compileNodeNodeTypeAttribute): (WebCore::compileNodeOwnerDocumentAttribute): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted. DOMJIT::GetterSetter becomes smaller constexpr data. LayoutTests: * js/dom/dom-getters-type-check-expected.txt: Added. * js/dom/dom-getters-type-check.html: Added. Canonical link: https://commits.webkit.org/191710@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-27 12:35:49 +00:00
Ref<JSC::DOMJIT::CallDOMGetterSnippet> compileDocumentDocumentElementAttribute()
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
{
[DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit https://bugs.webkit.org/show_bug.cgi?id=172260 Reviewed by Filip Pizlo. Source/JavaScriptCore: DOMJIT::Patchpoint is now used for generalized CheckSubClass. And it becomes mature enough to be used as a general-purpose injectable compiler over all the JIT tiers. We extract DOMJIT::Patchpoint to jit/ and rename it JSC::Snippet. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCaseSnippetParams.cpp: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.cpp. (JSC::SlowPathCallGeneratorWithArguments::generateImpl): (JSC::AccessCaseSnippetParams::emitSlowPathCalls): * bytecode/AccessCaseSnippetParams.h: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.h. (JSC::AccessCaseSnippetParams::AccessCaseSnippetParams): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::emitDOMJITGetter): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: * dfg/DFGNode.h: * dfg/DFGSnippetParams.cpp: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp. * dfg/DFGSnippetParams.h: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.h. (JSC::DFG::SnippetParams::SnippetParams): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::allocateTemporaryRegistersForSnippet): (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): (JSC::DFG::SpeculativeJIT::compileCheckSubClass): (JSC::DFG::allocateTemporaryRegistersForPatchpoint): Deleted. * domjit/DOMJITCallDOMGetterSnippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITCallDOMGetterPatchpoint.h. (JSC::DOMJIT::CallDOMGetterSnippet::create): * domjit/DOMJITGetterSetter.h: * domjit/DOMJITSignature.h: * domjit/DOMJITValue.h: Removed. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * ftl/FTLSnippetParams.cpp: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp. * ftl/FTLSnippetParams.h: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h. (JSC::FTL::SnippetParams::SnippetParams): * jit/Snippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpoint.h. (JSC::Snippet::create): (JSC::Snippet::setGenerator): (JSC::Snippet::generator): * jit/SnippetParams.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h. (JSC::SnippetParams::~SnippetParams): (JSC::SnippetParams::Value::Value): (JSC::SnippetParams::Value::isGPR): (JSC::SnippetParams::Value::isFPR): (JSC::SnippetParams::Value::isJSValueRegs): (JSC::SnippetParams::Value::gpr): (JSC::SnippetParams::Value::fpr): (JSC::SnippetParams::Value::jsValueRegs): (JSC::SnippetParams::Value::reg): (JSC::SnippetParams::Value::value): (JSC::SnippetParams::SnippetParams): * jit/SnippetReg.h: Renamed from Source/JavaScriptCore/domjit/DOMJITReg.h. (JSC::SnippetReg::SnippetReg): * jit/SnippetSlowPathCalls.h: Renamed from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h. * jsc.cpp: (WTF::DOMJITNode::checkSubClassSnippet): (WTF::DOMJITFunctionObject::checkSubClassSnippet): (WTF::DOMJITNode::checkSubClassPatchpoint): Deleted. (WTF::DOMJITFunctionObject::checkSubClassPatchpoint): Deleted. * runtime/ClassInfo.h: Source/WebCore: * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h. * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/test/JS/JSTestDOMJIT.h: * domjit/DOMJITCheckDOM.h: (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapper): * domjit/JSDocumentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocument): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): (WebCore::DocumentBodyDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSDocument): Deleted. * domjit/JSDocumentFragmentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocumentFragment): (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted. * domjit/JSElementDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSElement): (WebCore::checkSubClassPatchpointForJSElement): Deleted. * domjit/JSEventDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSEvent): (WebCore::checkSubClassPatchpointForJSEvent): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSNode): (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): (WebCore::NodeLastChildDOMJIT::callDOMGetter): (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): (WebCore::NodeParentNodeDOMJIT::callDOMGetter): (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSNode): Deleted. Canonical link: https://commits.webkit.org/189575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-27 19:03:41 +00:00
Ref<JSC::DOMJIT::CallDOMGetterSnippet> snippet = JSC::DOMJIT::CallDOMGetterSnippet::create();
snippet->numGPScratchRegisters = 1;
snippet->setGenerator([=](CCallHelpers& jit, JSC::SnippetParams& params) {
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
JSValueRegs result = params[0].jsValueRegs();
GPRReg document = params[1].gpr();
GPRReg globalObject = params[2].gpr();
JSValue globalObjectValue = params[2].value();
GPRReg scratch = params.gpScratch(0);
jit.loadPtr(CCallHelpers::Address(document, JSDocument::offsetOfWrapped()), scratch);
DOMJIT::loadDocumentElement(jit, scratch, scratch);
auto nullCase = jit.branchTestPtr(CCallHelpers::Zero, scratch);
DOMJIT::toWrapper<Element>(jit, params, scratch, globalObject, result, DOMJIT::operationToJSElement, globalObjectValue);
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
auto done = jit.jump();
nullCase.link(&jit);
jit.moveValue(jsNull(), result);
done.link(&jit);
return CCallHelpers::JumpList();
});
[DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit https://bugs.webkit.org/show_bug.cgi?id=172260 Reviewed by Filip Pizlo. Source/JavaScriptCore: DOMJIT::Patchpoint is now used for generalized CheckSubClass. And it becomes mature enough to be used as a general-purpose injectable compiler over all the JIT tiers. We extract DOMJIT::Patchpoint to jit/ and rename it JSC::Snippet. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCaseSnippetParams.cpp: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.cpp. (JSC::SlowPathCallGeneratorWithArguments::generateImpl): (JSC::AccessCaseSnippetParams::emitSlowPathCalls): * bytecode/AccessCaseSnippetParams.h: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.h. (JSC::AccessCaseSnippetParams::AccessCaseSnippetParams): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::emitDOMJITGetter): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: * dfg/DFGNode.h: * dfg/DFGSnippetParams.cpp: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp. * dfg/DFGSnippetParams.h: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.h. (JSC::DFG::SnippetParams::SnippetParams): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::allocateTemporaryRegistersForSnippet): (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): (JSC::DFG::SpeculativeJIT::compileCheckSubClass): (JSC::DFG::allocateTemporaryRegistersForPatchpoint): Deleted. * domjit/DOMJITCallDOMGetterSnippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITCallDOMGetterPatchpoint.h. (JSC::DOMJIT::CallDOMGetterSnippet::create): * domjit/DOMJITGetterSetter.h: * domjit/DOMJITSignature.h: * domjit/DOMJITValue.h: Removed. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * ftl/FTLSnippetParams.cpp: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp. * ftl/FTLSnippetParams.h: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h. (JSC::FTL::SnippetParams::SnippetParams): * jit/Snippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpoint.h. (JSC::Snippet::create): (JSC::Snippet::setGenerator): (JSC::Snippet::generator): * jit/SnippetParams.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h. (JSC::SnippetParams::~SnippetParams): (JSC::SnippetParams::Value::Value): (JSC::SnippetParams::Value::isGPR): (JSC::SnippetParams::Value::isFPR): (JSC::SnippetParams::Value::isJSValueRegs): (JSC::SnippetParams::Value::gpr): (JSC::SnippetParams::Value::fpr): (JSC::SnippetParams::Value::jsValueRegs): (JSC::SnippetParams::Value::reg): (JSC::SnippetParams::Value::value): (JSC::SnippetParams::SnippetParams): * jit/SnippetReg.h: Renamed from Source/JavaScriptCore/domjit/DOMJITReg.h. (JSC::SnippetReg::SnippetReg): * jit/SnippetSlowPathCalls.h: Renamed from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h. * jsc.cpp: (WTF::DOMJITNode::checkSubClassSnippet): (WTF::DOMJITFunctionObject::checkSubClassSnippet): (WTF::DOMJITNode::checkSubClassPatchpoint): Deleted. (WTF::DOMJITFunctionObject::checkSubClassPatchpoint): Deleted. * runtime/ClassInfo.h: Source/WebCore: * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h. * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/test/JS/JSTestDOMJIT.h: * domjit/DOMJITCheckDOM.h: (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapper): * domjit/JSDocumentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocument): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): (WebCore::DocumentBodyDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSDocument): Deleted. * domjit/JSDocumentFragmentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocumentFragment): (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted. * domjit/JSElementDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSElement): (WebCore::checkSubClassPatchpointForJSElement): Deleted. * domjit/JSEventDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSEvent): (WebCore::checkSubClassPatchpointForJSEvent): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSNode): (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): (WebCore::NodeLastChildDOMJIT::callDOMGetter): (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): (WebCore::NodeParentNodeDOMJIT::callDOMGetter): (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSNode): Deleted. Canonical link: https://commits.webkit.org/189575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-27 19:03:41 +00:00
snippet->effect = JSC::DOMJIT::Effect::forDef(DOMJIT::AbstractHeapRepository::Document_documentElement);
return snippet;
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
}
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
static void loadLocalName(CCallHelpers& jit, GPRReg htmlElement, GPRReg localNameImpl)
{
jit.loadPtr(CCallHelpers::Address(htmlElement, Element::tagQNameMemoryOffset() + QualifiedName::implMemoryOffset()), localNameImpl);
jit.loadPtr(CCallHelpers::Address(localNameImpl, QualifiedName::QualifiedNameImpl::localNameMemoryOffset()), localNameImpl);
}
Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=171637 Reviewed by Darin Adler. JSTests: * stress/domjit-getter-complex-with-incorrect-object.js: (i.shouldThrow): * stress/domjit-getter-type-check.js: Copied from JSTests/stress/domjit-getter-complex-with-incorrect-object.js. (shouldBe): (i.shouldThrow): Source/JavaScriptCore: Each DOM attribute getter has the code to perform ClassInfo check. But it is largely duplicate and causes code bloating. In this patch, we move ClassInfo check from WebCore to JSC and reduce code size. We introduce DOMAnnotation which has ClassInfo* and DOMJIT::GetterSetter*. If the getter is not DOMJIT getter, this DOMJIT::GetterSetter becomes nullptr. We support such a CustomAccessorGetter in all the JIT tiers. In IC, we drop CheckSubClass completely since IC's Structure check subsumes it. We do not enable this optimization for op_get_by_id_with_this case yet. In DFG and FTL, we emit CheckSubClass node. Which is typically removed by CheckStructure leading to CheckSubClass. And we add DOMAttributeGetterSetter, which is derived class of CustomGetterSetter. It holds DOMAnnotation and perform ClassInfo check. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCase.cpp: (JSC::AccessCase::generateImpl): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback): * bytecode/GetByIdVariant.cpp: (JSC::GetByIdVariant::GetByIdVariant): (JSC::GetByIdVariant::operator=): (JSC::GetByIdVariant::attemptToMerge): (JSC::GetByIdVariant::dumpInContext): * bytecode/GetByIdVariant.h: (JSC::GetByIdVariant::customAccessorGetter): (JSC::GetByIdVariant::domAttribute): (JSC::GetByIdVariant::domJIT): Deleted. * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::create): (JSC::GetterSetterAccessCase::GetterSetterAccessCase): (JSC::GetterSetterAccessCase::emitDOMJITGetter): * bytecode/GetterSetterAccessCase.h: (JSC::GetterSetterAccessCase::domAttribute): (JSC::GetterSetterAccessCase::customAccessor): (JSC::GetterSetterAccessCase::domJIT): Deleted. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::instantiateLexicalVariables): * create_hash_table: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): (JSC::DFG::ByteCodeParser::handleGetById): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGNode.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::callCustomGetter): * domjit/DOMJITGetterSetter.h: (JSC::DOMJIT::GetterSetter::GetterSetter): (JSC::DOMJIT::GetterSetter::getter): (JSC::DOMJIT::GetterSetter::compiler): (JSC::DOMJIT::GetterSetter::resultType): (JSC::DOMJIT::GetterSetter::~GetterSetter): Deleted. (JSC::DOMJIT::GetterSetter::setter): Deleted. (JSC::DOMJIT::GetterSetter::thisClassInfo): Deleted. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * jit/Repatch.cpp: (JSC::tryCacheGetByID): * jsc.cpp: (WTF::DOMJITGetter::DOMJITAttribute::DOMJITAttribute): (WTF::DOMJITGetter::DOMJITAttribute::callDOMGetter): (WTF::DOMJITGetter::customGetter): (WTF::DOMJITGetter::finishCreation): (WTF::DOMJITGetterComplex::DOMJITAttribute::DOMJITAttribute): (WTF::DOMJITGetterComplex::DOMJITAttribute::callDOMGetter): (WTF::DOMJITGetterComplex::customGetter): (WTF::DOMJITGetterComplex::finishCreation): (WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted. (WTF::DOMJITGetter::DOMJITNodeDOMJIT::slowCall): Deleted. (WTF::DOMJITGetter::domJITNodeGetterSetter): Deleted. (WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT): Deleted. (WTF::DOMJITGetterComplex::DOMJITNodeDOMJIT::slowCall): Deleted. (WTF::DOMJITGetterComplex::domJITNodeGetterSetter): Deleted. * runtime/CustomGetterSetter.h: (JSC::CustomGetterSetter::create): (JSC::CustomGetterSetter::setter): (JSC::CustomGetterSetter::CustomGetterSetter): (): Deleted. * runtime/DOMAnnotation.h: Added. (JSC::operator==): (JSC::operator!=): * runtime/DOMAttributeGetterSetter.cpp: Added. * runtime/DOMAttributeGetterSetter.h: Copied from Source/JavaScriptCore/runtime/CustomGetterSetter.h. (JSC::isDOMAttributeGetterSetter): * runtime/Error.cpp: (JSC::throwDOMAttributeGetterTypeError): * runtime/Error.h: (JSC::throwVMDOMAttributeGetterTypeError): * runtime/JSCustomGetterSetterFunction.cpp: (JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall): * runtime/JSObject.cpp: (JSC::JSObject::putInlineSlow): (JSC::JSObject::deleteProperty): (JSC::JSObject::getOwnStaticPropertySlot): (JSC::JSObject::reifyAllStaticProperties): (JSC::JSObject::fillGetterPropertySlot): (JSC::JSObject::findPropertyHashEntry): Deleted. * runtime/JSObject.h: (JSC::JSObject::getOwnNonIndexPropertySlot): (JSC::JSObject::fillCustomGetterPropertySlot): * runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot): * runtime/Lookup.h: (JSC::HashTableValue::domJIT): (JSC::getStaticPropertySlotFromTable): (JSC::putEntry): (JSC::lookupPut): (JSC::reifyStaticProperty): (JSC::reifyStaticProperties): Each static property table has a new field ClassInfo*. It indicates that which ClassInfo check DOMAttribute registered in this static property table requires. * runtime/ProgramExecutable.cpp: (JSC::ProgramExecutable::initializeGlobalProperties): * runtime/PropertyName.h: * runtime/PropertySlot.cpp: (JSC::PropertySlot::customGetter): (JSC::PropertySlot::customAccessorGetter): * runtime/PropertySlot.h: (JSC::PropertySlot::domAttribute): (JSC::PropertySlot::setCustom): (JSC::PropertySlot::setCacheableCustom): (JSC::PropertySlot::getValue): (JSC::PropertySlot::domJIT): Deleted. * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: Source/WebCore: We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side. So, we can drop ClassInfo check from the actual function. We also simplify DOMJIT::GetterSetter to make it smaller size. WebCore size comparison Before: 48443292 After: 48087800 (0.7% reduction) Speedometer Scores show 0.8% improvement. Before: 158.9 +- 0.46 After: 160.2 +- 0.36 Dromaeo DOM core Scores show 5.8% improvement. Before After Total Score: 8424.12runs/s ±1.38% 8911.60runs/s ±1.47% DOM Attributes 12627.27runs/s ±1.87% 14023.17runs/s ±1.87% DOM Modification 1207.82runs/s ±2.48% 1204.21runs/s ±3.05% DOM Query 68068.82runs/s ±0.63% 74273.38runs/s ±0.69% DOM Traversal 1240.07runs/s ±1.96% 1256.64runs/s ±1.77% Performance improvement can be explained by the following optimizations. 1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can drop type checks since get_by_id operation already performs a structure check which subsumes this type check. 2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast. * bindings/scripts/CodeGeneratorJS.pm: (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeGetterDefinition): (GenerateCallbackImplementationContent): (GenerateHashTableValueArray): (GenerateHashTable): (GenerateConstructorHelperMethods): Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size. * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceNamePrototype::finishCreation): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLikePrototype::finishCreation): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectPrototype::finishCreation): (WebCore::jsTestActiveDOMObjectExcitingAttr): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactionsPrototype::finishCreation): (WebCore::jsTestCEReactionsAttributeWithCEReactions): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions): (WebCore::jsTestCEReactionsStringifierAttribute): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation): (WebCore::jsTestCEReactionsStringifierValue): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerPrototype::finishCreation): (WebCore::jsTestCallTracerTestAttributeInterface): (WebCore::jsTestCallTracerTestAttributeSpecified): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJITPrototype::finishCreation): (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted. (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted. (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted. (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted. (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted. (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted. (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted. (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted. (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted. (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted. (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted. (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted. (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted. (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted. (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted. (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted. (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted. (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted. (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted. (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted. (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted. (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted. (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted. (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted. (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted. (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted. (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted. (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted. (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted. * bindings/scripts/test/JS/JSTestDOMJIT.h: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorPrototype::finishCreation): (WebCore::jsTestEventConstructorAttr1): (WebCore::jsTestEventConstructorAttr2): (WebCore::jsTestEventConstructorAttr3): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTargetPrototype::finishCreation): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestExceptionPrototype::finishCreation): (WebCore::jsTestExceptionName): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): (WebCore::jsTestGenerateIsReachableASecretAttribute): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttribute): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::initializeProperties): (WebCore::JSTestInterfacePrototype::finishCreation): (WebCore::jsTestInterfaceImplementsStr1): (WebCore::jsTestInterfaceImplementsStr2): (WebCore::jsTestInterfaceImplementsStr3): (WebCore::jsTestInterfaceImplementsNode): (WebCore::jsTestInterfaceSupplementalStr1): (WebCore::jsTestInterfaceSupplementalStr2): (WebCore::jsTestInterfaceSupplementalStr3): (WebCore::jsTestInterfaceSupplementalNode): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation): (WebCore::jsTestInterfaceLeadingUnderscoreReadonly): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterablePrototype::finishCreation): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::finishCreation): (WebCore::jsTestNodeName): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::initializeProperties): (WebCore::JSTestObjPrototype::finishCreation): (WebCore::jsTestObjReadOnlyLongAttr): (WebCore::jsTestObjReadOnlyStringAttr): (WebCore::jsTestObjReadOnlyTestObjAttr): (WebCore::jsTestObjEnumAttr): (WebCore::jsTestObjByteAttr): (WebCore::jsTestObjOctetAttr): (WebCore::jsTestObjShortAttr): (WebCore::jsTestObjClampedShortAttr): (WebCore::jsTestObjEnforceRangeShortAttr): (WebCore::jsTestObjUnsignedShortAttr): (WebCore::jsTestObjLongAttr): (WebCore::jsTestObjLongLongAttr): (WebCore::jsTestObjUnsignedLongLongAttr): (WebCore::jsTestObjStringAttr): (WebCore::jsTestObjUsvstringAttr): (WebCore::jsTestObjTestObjAttr): (WebCore::jsTestObjTestNullableObjAttr): (WebCore::jsTestObjUnforgeableAttr): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjStringLongRecordAttr): (WebCore::jsTestObjUsvstringLongRecordAttr): (WebCore::jsTestObjStringObjRecordAttr): (WebCore::jsTestObjStringNullableObjRecordAttr): (WebCore::jsTestObjDictionaryAttr): (WebCore::jsTestObjNullableDictionaryAttr): (WebCore::jsTestObjAnnotatedTypeInUnionAttr): (WebCore::jsTestObjAnnotatedTypeInSequenceAttr): (WebCore::jsTestObjImplementationEnumAttr): (WebCore::jsTestObjXMLObjAttr): (WebCore::jsTestObjCreate): (WebCore::jsTestObjReflectedStringAttr): (WebCore::jsTestObjReflectedUSVStringAttr): (WebCore::jsTestObjReflectedIntegralAttr): (WebCore::jsTestObjReflectedUnsignedIntegralAttr): (WebCore::jsTestObjReflectedBooleanAttr): (WebCore::jsTestObjReflectedURLAttr): (WebCore::jsTestObjReflectedUSVURLAttr): (WebCore::jsTestObjReflectedCustomIntegralAttr): (WebCore::jsTestObjReflectedCustomBooleanAttr): (WebCore::jsTestObjReflectedCustomURLAttr): (WebCore::jsTestObjEnabledAtRuntimeAttribute): (WebCore::jsTestObjEnabledBySettingAttribute): (WebCore::jsTestObjTypedArrayAttr): (WebCore::jsTestObjAttributeWithGetterException): (WebCore::jsTestObjAttributeWithSetterException): (WebCore::jsTestObjStringAttrWithGetterException): (WebCore::jsTestObjStringAttrWithSetterException): (WebCore::jsTestObjCustomAttr): (WebCore::jsTestObjOnfoo): (WebCore::jsTestObjOnwebkitfoo): (WebCore::jsTestObjWithScriptStateAttribute): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::jsTestObjWithScriptExecutionContextAttribute): (WebCore::jsTestObjWithScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): (WebCore::jsTestObjConditionalAttr1): (WebCore::jsTestObjConditionalAttr2): (WebCore::jsTestObjConditionalAttr3): (WebCore::jsTestObjCachedAttribute1): (WebCore::jsTestObjCachedAttribute2): (WebCore::jsTestObjAnyAttribute): (WebCore::jsTestObjObjectAttribute): (WebCore::jsTestObjContentDocument): (WebCore::jsTestObjMutablePoint): (WebCore::jsTestObjStrawberry): (WebCore::jsTestObjDescription): (WebCore::jsTestObjId): (WebCore::jsTestObjHash): (WebCore::jsTestObjReplaceableAttribute): (WebCore::jsTestObjNullableDoubleAttribute): (WebCore::jsTestObjNullableLongAttribute): (WebCore::jsTestObjNullableBooleanAttribute): (WebCore::jsTestObjNullableStringAttribute): (WebCore::jsTestObjNullableLongSettableAttribute): (WebCore::jsTestObjNullableStringSettableAttribute): (WebCore::jsTestObjNullableUSVStringSettableAttribute): (WebCore::jsTestObjNullableByteStringSettableAttribute): (WebCore::jsTestObjNullableStringValue): (WebCore::jsTestObjAttribute): (WebCore::jsTestObjAttributeWithReservedEnumType): (WebCore::jsTestObjPutForwardsAttribute): (WebCore::jsTestObjPutForwardsNullableAttribute): (WebCore::jsTestObjStringifierAttribute): (WebCore::jsTestObjConditionallyReadWriteAttribute): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterfacePrototype::finishCreation): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation): (WebCore::jsTestPromiseRejectionEventReason): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerializationPrototype::finishCreation): (WebCore::jsTestSerializationFirstStringAttribute): (WebCore::jsTestSerializationSecondLongAttribute): (WebCore::jsTestSerializationThirdUnserializableAttribute): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute): (WebCore::jsTestSerializationFifthLongAttribute): (WebCore::jsTestSerializationSixthTypedefAttribute): (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute): (WebCore::jsTestSerializationEighthIndirectlyAttribute): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInheritPrototype::finishCreation): (WebCore::jsTestSerializationInheritInheritLongAttribute): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue): (WebCore::jsTestSerializedScriptValueInterfaceCachedValue): (WebCore::jsTestSerializedScriptValueInterfacePorts): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifierPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadOnlyAttributeIdentifier): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation): (WebCore::jsTestStringifierReadWriteAttributeIdentifier): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::initializeProperties): (WebCore::JSTestTypedefsPrototype::finishCreation): (WebCore::jsTestTypedefsUnsignedLongLongAttr): (WebCore::jsTestTypedefsSerializedScriptValue): (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsAttrWithGetterException): (WebCore::jsTestTypedefsAttrWithSetterException): (WebCore::jsTestTypedefsStringAttrWithGetterException): (WebCore::jsTestTypedefsStringAttrWithSetterException): (WebCore::jsTestTypedefsBufferSourceAttr): (WebCore::jsTestTypedefsDomTimeStampAttr): They are binding test rebaselines. * domjit/DOMJITIDLTypeFilter.h: * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentDocumentElementAttribute): (WebCore::compileDocumentBodyAttribute): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted. (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::compileNodeFirstChildAttribute): (WebCore::compileNodeLastChildAttribute): (WebCore::compileNodeNextSiblingAttribute): (WebCore::compileNodePreviousSiblingAttribute): (WebCore::compileNodeParentNodeAttribute): (WebCore::compileNodeNodeTypeAttribute): (WebCore::compileNodeOwnerDocumentAttribute): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted. (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted. (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted. DOMJIT::GetterSetter becomes smaller constexpr data. LayoutTests: * js/dom/dom-getters-type-check-expected.txt: Added. * js/dom/dom-getters-type-check.html: Added. Canonical link: https://commits.webkit.org/191710@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-27 12:35:49 +00:00
Ref<JSC::DOMJIT::CallDOMGetterSnippet> compileDocumentBodyAttribute()
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
{
[DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit https://bugs.webkit.org/show_bug.cgi?id=172260 Reviewed by Filip Pizlo. Source/JavaScriptCore: DOMJIT::Patchpoint is now used for generalized CheckSubClass. And it becomes mature enough to be used as a general-purpose injectable compiler over all the JIT tiers. We extract DOMJIT::Patchpoint to jit/ and rename it JSC::Snippet. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCaseSnippetParams.cpp: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.cpp. (JSC::SlowPathCallGeneratorWithArguments::generateImpl): (JSC::AccessCaseSnippetParams::emitSlowPathCalls): * bytecode/AccessCaseSnippetParams.h: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.h. (JSC::AccessCaseSnippetParams::AccessCaseSnippetParams): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::emitDOMJITGetter): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: * dfg/DFGNode.h: * dfg/DFGSnippetParams.cpp: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp. * dfg/DFGSnippetParams.h: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.h. (JSC::DFG::SnippetParams::SnippetParams): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::allocateTemporaryRegistersForSnippet): (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): (JSC::DFG::SpeculativeJIT::compileCheckSubClass): (JSC::DFG::allocateTemporaryRegistersForPatchpoint): Deleted. * domjit/DOMJITCallDOMGetterSnippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITCallDOMGetterPatchpoint.h. (JSC::DOMJIT::CallDOMGetterSnippet::create): * domjit/DOMJITGetterSetter.h: * domjit/DOMJITSignature.h: * domjit/DOMJITValue.h: Removed. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * ftl/FTLSnippetParams.cpp: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp. * ftl/FTLSnippetParams.h: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h. (JSC::FTL::SnippetParams::SnippetParams): * jit/Snippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpoint.h. (JSC::Snippet::create): (JSC::Snippet::setGenerator): (JSC::Snippet::generator): * jit/SnippetParams.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h. (JSC::SnippetParams::~SnippetParams): (JSC::SnippetParams::Value::Value): (JSC::SnippetParams::Value::isGPR): (JSC::SnippetParams::Value::isFPR): (JSC::SnippetParams::Value::isJSValueRegs): (JSC::SnippetParams::Value::gpr): (JSC::SnippetParams::Value::fpr): (JSC::SnippetParams::Value::jsValueRegs): (JSC::SnippetParams::Value::reg): (JSC::SnippetParams::Value::value): (JSC::SnippetParams::SnippetParams): * jit/SnippetReg.h: Renamed from Source/JavaScriptCore/domjit/DOMJITReg.h. (JSC::SnippetReg::SnippetReg): * jit/SnippetSlowPathCalls.h: Renamed from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h. * jsc.cpp: (WTF::DOMJITNode::checkSubClassSnippet): (WTF::DOMJITFunctionObject::checkSubClassSnippet): (WTF::DOMJITNode::checkSubClassPatchpoint): Deleted. (WTF::DOMJITFunctionObject::checkSubClassPatchpoint): Deleted. * runtime/ClassInfo.h: Source/WebCore: * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h. * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/test/JS/JSTestDOMJIT.h: * domjit/DOMJITCheckDOM.h: (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapper): * domjit/JSDocumentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocument): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): (WebCore::DocumentBodyDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSDocument): Deleted. * domjit/JSDocumentFragmentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocumentFragment): (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted. * domjit/JSElementDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSElement): (WebCore::checkSubClassPatchpointForJSElement): Deleted. * domjit/JSEventDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSEvent): (WebCore::checkSubClassPatchpointForJSEvent): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSNode): (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): (WebCore::NodeLastChildDOMJIT::callDOMGetter): (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): (WebCore::NodeParentNodeDOMJIT::callDOMGetter): (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSNode): Deleted. Canonical link: https://commits.webkit.org/189575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-27 19:03:41 +00:00
Ref<JSC::DOMJIT::CallDOMGetterSnippet> snippet = JSC::DOMJIT::CallDOMGetterSnippet::create();
snippet->numGPScratchRegisters = 2;
snippet->setGenerator([=](CCallHelpers& jit, JSC::SnippetParams& params) {
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
JSValueRegs result = params[0].jsValueRegs();
GPRReg document = params[1].gpr();
GPRReg globalObject = params[2].gpr();
JSValue globalObjectValue = params[2].value();
GPRReg scratch1 = params.gpScratch(0);
GPRReg scratch2 = params.gpScratch(1);
jit.loadPtr(CCallHelpers::Address(document, JSDocument::offsetOfWrapped()), scratch1);
DOMJIT::loadDocumentElement(jit, scratch1, scratch1);
CCallHelpers::JumpList nullCases;
CCallHelpers::JumpList successCases;
nullCases.append(jit.branchTestPtr(CCallHelpers::Zero, scratch1));
nullCases.append(DOMJIT::branchTestIsHTMLFlagOnNode(jit, CCallHelpers::Zero, scratch1));
// We ensured that the name of the given element is HTML qualified.
// It allows us to perform local name comparison!
loadLocalName(jit, scratch1, scratch2);
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames https://bugs.webkit.org/show_bug.cgi?id=175118 Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-30 Reviewed by Alex Christensen. Source/WebCore: Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. No new tests since there should be no behavioral change. * dom/make_names.pl: (printConstructors): (printNamesHeaderFile): (printNamesCppFile): (printDefinitions): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const): * css/StyleResolver.cpp: (WebCore::hasEffectiveDisplayNoneForDisplayContents): * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::observesStyleAttribute const): * dom/Document.cpp: (WebCore::Document::validateCustomElementName): * dom/Element.cpp: (WebCore::isStyleAttribute): (WebCore::canAttachAuthorShadowRoot): * dom/ElementData.cpp: (WebCore::ElementData::findLanguageAttribute const): * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentBodyAttribute): * editing/Editor.cpp: (WebCore::Editor::applyEditingStyleToBodyElement const): * editing/EditorCommand.cpp: (WebCore::valueDefaultParagraphSeparator): * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): (WebCore::MarkupAccumulator::appendNamespace): (WebCore::MarkupAccumulator::elementCannotHaveEndTag): * editing/ReplaceSelectionCommand.cpp: (WebCore::isProhibitedParagraphChild): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::isCaseSensitiveAttribute): * html/HTMLElement.cpp: (WebCore::HTMLElement::createEventHandlerNameMap): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::findFosterSite): * html/parser/HTMLElementStack.cpp: (WebCore::HTMLElementStack::hasTemplateInHTMLScope const): * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::updatePredictedBaseURL): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope): (WebCore::HTMLTreeBuilder::processStartTagForInBody): (WebCore::HTMLTreeBuilder::processTemplateEndTag): (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents): (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody): (WebCore::HTMLTreeBuilder::processEndTagForInBody): (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption): (WebCore::HTMLTreeBuilder::processTableEndTagForInTable): (WebCore::HTMLTreeBuilder::processEndTag): (WebCore::HTMLTreeBuilder::insertPhoneNumberLink): (WebCore::HTMLTreeBuilder::defaultForBeforeHTML): (WebCore::HTMLTreeBuilder::defaultForBeforeHead): (WebCore::HTMLTreeBuilder::defaultForInHead): (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript): (WebCore::HTMLTreeBuilder::defaultForAfterHead): * html/parser/TextDocumentParser.cpp: (WebCore::TextDocumentParser::insertFakePreElement): * rendering/svg/SVGPathData.cpp: (WebCore::pathFromGraphicsElement): * rendering/svg/SVGResources.cpp: (WebCore::clipperFilterMaskerTags): (WebCore::markerTags): (WebCore::fillAndStrokeTags): (WebCore::chainableResourceTags): * svg/SVGAnimatedBoolean.h: * svg/SVGAnimatedEnumeration.h: * svg/SVGAnimatedInteger.h: * svg/SVGAnimatedLength.h: * svg/SVGAnimatedLengthList.h: * svg/SVGAnimatedNumber.h: * svg/SVGAnimatedNumberList.h: * svg/SVGAnimatedPreserveAspectRatio.h: * svg/SVGAnimatedRect.h: * svg/SVGAnimatedString.h: * svg/SVGAnimatedTransformList.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::isSupportedAttribute): * svg/SVGCursorElement.cpp: (WebCore::SVGCursorElement::isSupportedAttribute): * svg/SVGElement.cpp: (WebCore::createAttributeNameToCSSPropertyIDMap): (WebCore::SVGElement::childShouldCreateRenderer const): (WebCore::SVGElement::animatableAttributeForName): * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::isSupportedAttribute): * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::isSupportedAttribute): * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::isSupportedAttribute): * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::isSupportedAttribute): * svg/SVGLineElement.cpp: (WebCore::SVGLineElement::isSupportedAttribute): * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::isSupportedAttribute): * svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::isSupportedAttribute): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::dPropertyInfo): (WebCore::SVGPathElement::isSupportedAttribute): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::isSupportedAttribute): * svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::pointsPropertyInfo): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::isSupportedAttribute): * svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::textLengthPropertyInfo): (WebCore::SVGTextContentElement::isSupportedAttribute): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::isSupportedAttribute): * svg/SVGUseElement.cpp: (WebCore::createAllowedElementSet): * xml/NativeXPathNSResolver.cpp: (WebCore::NativeXPathNSResolver::lookupNamespaceURI): * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::parseDocumentFragment): Source/WebKit: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: (WebKit::wrap): Canonical link: https://commits.webkit.org/195175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-30 23:41:01 +00:00
nullCases.append(jit.branchPtr(CCallHelpers::NotEqual, scratch2, CCallHelpers::TrustedImmPtr(HTMLNames::htmlTag->localName().impl())));
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
RELEASE_ASSERT(!CAST_OFFSET(Node*, ContainerNode*));
RELEASE_ASSERT(!CAST_OFFSET(Node*, Element*));
RELEASE_ASSERT(!CAST_OFFSET(Node*, HTMLElement*));
// Node* node = current.firstChild();
// while (node && !is<HTMLElement>(*node))
// node = node->nextSibling();
// return downcast<HTMLElement>(node);
jit.loadPtr(CCallHelpers::Address(scratch1, ContainerNode::firstChildMemoryOffset()), scratch1);
CCallHelpers::Label loopStart = jit.label();
nullCases.append(jit.branchTestPtr(CCallHelpers::Zero, scratch1));
auto notHTMLElementCase = DOMJIT::branchTestIsHTMLFlagOnNode(jit, CCallHelpers::Zero, scratch1);
// We ensured that the name of the given element is HTML qualified.
// It allows us to perform local name comparison!
loadLocalName(jit, scratch1, scratch2);
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames https://bugs.webkit.org/show_bug.cgi?id=175118 Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-30 Reviewed by Alex Christensen. Source/WebCore: Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed. No new tests since there should be no behavioral change. * dom/make_names.pl: (printConstructors): (printNamesHeaderFile): (printNamesCppFile): (printDefinitions): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const): * css/StyleResolver.cpp: (WebCore::hasEffectiveDisplayNoneForDisplayContents): * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::observesStyleAttribute const): * dom/Document.cpp: (WebCore::Document::validateCustomElementName): * dom/Element.cpp: (WebCore::isStyleAttribute): (WebCore::canAttachAuthorShadowRoot): * dom/ElementData.cpp: (WebCore::ElementData::findLanguageAttribute const): * domjit/JSDocumentDOMJIT.cpp: (WebCore::compileDocumentBodyAttribute): * editing/Editor.cpp: (WebCore::Editor::applyEditingStyleToBodyElement const): * editing/EditorCommand.cpp: (WebCore::valueDefaultParagraphSeparator): * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): (WebCore::MarkupAccumulator::appendNamespace): (WebCore::MarkupAccumulator::elementCannotHaveEndTag): * editing/ReplaceSelectionCommand.cpp: (WebCore::isProhibitedParagraphChild): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::isCaseSensitiveAttribute): * html/HTMLElement.cpp: (WebCore::HTMLElement::createEventHandlerNameMap): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::findFosterSite): * html/parser/HTMLElementStack.cpp: (WebCore::HTMLElementStack::hasTemplateInHTMLScope const): * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::updatePredictedBaseURL): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope): (WebCore::HTMLTreeBuilder::processStartTagForInBody): (WebCore::HTMLTreeBuilder::processTemplateEndTag): (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents): (WebCore::HTMLTreeBuilder::processStartTag): (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody): (WebCore::HTMLTreeBuilder::processEndTagForInBody): (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption): (WebCore::HTMLTreeBuilder::processTableEndTagForInTable): (WebCore::HTMLTreeBuilder::processEndTag): (WebCore::HTMLTreeBuilder::insertPhoneNumberLink): (WebCore::HTMLTreeBuilder::defaultForBeforeHTML): (WebCore::HTMLTreeBuilder::defaultForBeforeHead): (WebCore::HTMLTreeBuilder::defaultForInHead): (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript): (WebCore::HTMLTreeBuilder::defaultForAfterHead): * html/parser/TextDocumentParser.cpp: (WebCore::TextDocumentParser::insertFakePreElement): * rendering/svg/SVGPathData.cpp: (WebCore::pathFromGraphicsElement): * rendering/svg/SVGResources.cpp: (WebCore::clipperFilterMaskerTags): (WebCore::markerTags): (WebCore::fillAndStrokeTags): (WebCore::chainableResourceTags): * svg/SVGAnimatedBoolean.h: * svg/SVGAnimatedEnumeration.h: * svg/SVGAnimatedInteger.h: * svg/SVGAnimatedLength.h: * svg/SVGAnimatedLengthList.h: * svg/SVGAnimatedNumber.h: * svg/SVGAnimatedNumberList.h: * svg/SVGAnimatedPreserveAspectRatio.h: * svg/SVGAnimatedRect.h: * svg/SVGAnimatedString.h: * svg/SVGAnimatedTransformList.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::isSupportedAttribute): * svg/SVGCursorElement.cpp: (WebCore::SVGCursorElement::isSupportedAttribute): * svg/SVGElement.cpp: (WebCore::createAttributeNameToCSSPropertyIDMap): (WebCore::SVGElement::childShouldCreateRenderer const): (WebCore::SVGElement::animatableAttributeForName): * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::isSupportedAttribute): * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::isSupportedAttribute): * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::isSupportedAttribute): * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::isSupportedAttribute): * svg/SVGLineElement.cpp: (WebCore::SVGLineElement::isSupportedAttribute): * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::isSupportedAttribute): * svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::isSupportedAttribute): * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::dPropertyInfo): (WebCore::SVGPathElement::isSupportedAttribute): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::isSupportedAttribute): * svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::pointsPropertyInfo): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::isSupportedAttribute): * svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::textLengthPropertyInfo): (WebCore::SVGTextContentElement::isSupportedAttribute): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::isSupportedAttribute): * svg/SVGUseElement.cpp: (WebCore::createAllowedElementSet): * xml/NativeXPathNSResolver.cpp: (WebCore::NativeXPathNSResolver::lookupNamespaceURI): * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::parseDocumentFragment): Source/WebKit: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: (WebKit::wrap): Canonical link: https://commits.webkit.org/195175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-30 23:41:01 +00:00
successCases.append(jit.branchPtr(CCallHelpers::Equal, scratch2, CCallHelpers::TrustedImmPtr(HTMLNames::bodyTag->localName().impl())));
successCases.append(jit.branchPtr(CCallHelpers::Equal, scratch2, CCallHelpers::TrustedImmPtr(HTMLNames::framesetTag->localName().impl())));
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
notHTMLElementCase.link(&jit);
jit.loadPtr(CCallHelpers::Address(scratch1, Node::nextSiblingMemoryOffset()), scratch1);
jit.jump().linkTo(loopStart, &jit);
successCases.link(&jit);
DOMJIT::toWrapper<HTMLElement>(jit, params, scratch1, globalObject, result, DOMJIT::operationToJSHTMLElement, globalObjectValue);
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
auto done = jit.jump();
nullCases.link(&jit);
jit.moveValue(jsNull(), result);
done.link(&jit);
return CCallHelpers::JumpList();
});
[DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit https://bugs.webkit.org/show_bug.cgi?id=172260 Reviewed by Filip Pizlo. Source/JavaScriptCore: DOMJIT::Patchpoint is now used for generalized CheckSubClass. And it becomes mature enough to be used as a general-purpose injectable compiler over all the JIT tiers. We extract DOMJIT::Patchpoint to jit/ and rename it JSC::Snippet. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/AccessCaseSnippetParams.cpp: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.cpp. (JSC::SlowPathCallGeneratorWithArguments::generateImpl): (JSC::AccessCaseSnippetParams::emitSlowPathCalls): * bytecode/AccessCaseSnippetParams.h: Renamed from Source/JavaScriptCore/bytecode/DOMJITAccessCasePatchpointParams.h. (JSC::AccessCaseSnippetParams::AccessCaseSnippetParams): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::emitDOMJITGetter): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::blessCallDOMGetter): (JSC::DFG::ByteCodeParser::handleDOMJITGetter): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.h: * dfg/DFGNode.h: * dfg/DFGSnippetParams.cpp: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.cpp. * dfg/DFGSnippetParams.h: Renamed from Source/JavaScriptCore/dfg/DFGDOMJITPatchpointParams.h. (JSC::DFG::SnippetParams::SnippetParams): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::allocateTemporaryRegistersForSnippet): (JSC::DFG::SpeculativeJIT::compileCallDOMGetter): (JSC::DFG::SpeculativeJIT::compileCheckSubClass): (JSC::DFG::allocateTemporaryRegistersForPatchpoint): Deleted. * domjit/DOMJITCallDOMGetterSnippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITCallDOMGetterPatchpoint.h. (JSC::DOMJIT::CallDOMGetterSnippet::create): * domjit/DOMJITGetterSetter.h: * domjit/DOMJITSignature.h: * domjit/DOMJITValue.h: Removed. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter): * ftl/FTLSnippetParams.cpp: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.cpp. * ftl/FTLSnippetParams.h: Renamed from Source/JavaScriptCore/ftl/FTLDOMJITPatchpointParams.h. (JSC::FTL::SnippetParams::SnippetParams): * jit/Snippet.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpoint.h. (JSC::Snippet::create): (JSC::Snippet::setGenerator): (JSC::Snippet::generator): * jit/SnippetParams.h: Renamed from Source/JavaScriptCore/domjit/DOMJITPatchpointParams.h. (JSC::SnippetParams::~SnippetParams): (JSC::SnippetParams::Value::Value): (JSC::SnippetParams::Value::isGPR): (JSC::SnippetParams::Value::isFPR): (JSC::SnippetParams::Value::isJSValueRegs): (JSC::SnippetParams::Value::gpr): (JSC::SnippetParams::Value::fpr): (JSC::SnippetParams::Value::jsValueRegs): (JSC::SnippetParams::Value::reg): (JSC::SnippetParams::Value::value): (JSC::SnippetParams::SnippetParams): * jit/SnippetReg.h: Renamed from Source/JavaScriptCore/domjit/DOMJITReg.h. (JSC::SnippetReg::SnippetReg): * jit/SnippetSlowPathCalls.h: Renamed from Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h. * jsc.cpp: (WTF::DOMJITNode::checkSubClassSnippet): (WTF::DOMJITFunctionObject::checkSubClassSnippet): (WTF::DOMJITNode::checkSubClassPatchpoint): Deleted. (WTF::DOMJITFunctionObject::checkSubClassPatchpoint): Deleted. * runtime/ClassInfo.h: Source/WebCore: * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h. * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): * bindings/scripts/test/JS/JSTestDOMJIT.h: * domjit/DOMJITCheckDOM.h: (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapper): * domjit/JSDocumentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocument): (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): (WebCore::DocumentBodyDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSDocument): Deleted. * domjit/JSDocumentFragmentDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSDocumentFragment): (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted. * domjit/JSElementDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSElement): (WebCore::checkSubClassPatchpointForJSElement): Deleted. * domjit/JSEventDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSEvent): (WebCore::checkSubClassPatchpointForJSEvent): Deleted. * domjit/JSNodeDOMJIT.cpp: (WebCore::checkSubClassSnippetForJSNode): (WebCore::createCallDOMGetterForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::callDOMGetter): (WebCore::NodeLastChildDOMJIT::callDOMGetter): (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): (WebCore::NodeParentNodeDOMJIT::callDOMGetter): (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): (WebCore::checkSubClassPatchpointForJSNode): Deleted. Canonical link: https://commits.webkit.org/189575@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-27 19:03:41 +00:00
snippet->effect = JSC::DOMJIT::Effect::forDef(DOMJIT::AbstractHeapRepository::Document_body);
return snippet;
[DOMJIT] Document#body should have DOMJIT patchpoint https://bugs.webkit.org/show_bug.cgi?id=164627 Reviewed by Darin Adler. Source/WebCore: This patch implements document.body accessor. To implement it, we need, 1. DOM traversing ability from ASM. 2. Checking HTMLElement. 3. Checking HTMLElement's localName. The above features are already implemented in CSSJIT. We extract some of utilities from CSSJIT to share them with DOMJIT. Test: js/dom/domjit-accessor-document-body.html * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToNextAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacentElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName): (WebCore::SelectorCompiler::testIsElementFlagOnNode): Deleted. (WebCore::SelectorCompiler::testIsHTMLFlagOnNode): Deleted. * dom/Document.idl: * dom/Element.h: * dom/QualifiedName.h: * domjit/DOMJITAbstractHeapRepository.yaml: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsElementFlagOnNode): (WebCore::DOMJIT::branchTestIsHTMLFlagOnNode): * domjit/JSDocumentDOMJIT.cpp: (WebCore::DocumentBodyDOMJIT::checkDOM): (WebCore::loadLocalName): (WebCore::DocumentBodyDOMJIT::callDOMGetter): LayoutTests: * js/dom/domjit-accessor-document-body-expected.txt: Added. * js/dom/domjit-accessor-document-body.html: Added. Canonical link: https://commits.webkit.org/182302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-11 06:08:18 +00:00
}
[JSC] Introduce JITOperationList to validate JIT-caged pointers https://bugs.webkit.org/show_bug.cgi?id=217261 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds JITOperationList, which manages all the host-function & jit-operation pointers. And we can now query whether the given pointer is registered in this table. Currently, as a test, we are verifying that host-function is registered in this table when creating NativeExecutable in debug build. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * assembler/JITOperationList.cpp: Added. (JSC::JITOperationList::initialize): (JSC::addPointers): (JSC::JITOperationList::populatePointersInJavaScriptCore): (JSC::JITOperationList::populatePointersInEmbedder): * assembler/JITOperationList.h: Added. (JSC::JITOperationList::contains const): (JSC::JITOperationList::assertIsHostFunction): (JSC::JITOperationList::assertIsJITOperation): (JSC::JITOperationList::instance): * assembler/MacroAssemblerARM64.cpp: * assembler/MacroAssemblerARMv7.cpp: * assembler/MacroAssemblerMIPS.cpp: * assembler/MacroAssemblerX86Common.cpp: * jsc.cpp: (jscmain): * runtime/InitializeThreading.cpp: (JSC::initialize): * runtime/JSGenericTypedArrayViewPrototypeFunctions.h: (JSC::genericTypedArrayViewProtoFuncSet): (JSC::genericTypedArrayViewProtoFuncCopyWithin): (JSC::genericTypedArrayViewProtoFuncIncludes): (JSC::genericTypedArrayViewProtoFuncIndexOf): (JSC::genericTypedArrayViewProtoFuncJoin): (JSC::genericTypedArrayViewProtoFuncLastIndexOf): (JSC::genericTypedArrayViewProtoGetterFuncBuffer): (JSC::genericTypedArrayViewProtoGetterFuncLength): (JSC::genericTypedArrayViewProtoGetterFuncByteLength): (JSC::genericTypedArrayViewProtoGetterFuncByteOffset): (JSC::genericTypedArrayViewProtoFuncReverse): (JSC::genericTypedArrayViewPrivateFuncSort): (JSC::genericTypedArrayViewProtoFuncSlice): (JSC::genericTypedArrayViewPrivateFuncSubarrayCreate): (JSC::JSC_DEFINE_HOST_FUNCTION): Deleted. * runtime/VM.cpp: (JSC::VM::getHostFunction): Source/WebCore: We should have WebCore::initialize(). It is filed in https://bugs.webkit.org/show_bug.cgi?id=217270. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMBuiltinConstructor.h: * bindings/js/JSDOMConstructor.h: * bindings/js/JSDOMLegacyFactoryFunction.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initializeMainThread): * bindings/js/WebCoreJITOperations.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebCore::populateJITOperations): * bindings/js/WebCoreJITOperations.h: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinitions): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bridge/objc/WebScriptObject.mm: (+[WebScriptObject initialize]): * domjit/JSDocumentDOMJIT.cpp: * platform/cocoa/SharedBufferCocoa.mm: (+[WebCoreSharedBufferData initialize]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): Source/WebKit: * Shared/API/c/WKString.cpp: (WKStringCopyJSString): * Shared/Cocoa/WebKit2InitializeCocoa.mm: (WebKit::runInitializationCode): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * Shared/WebKitJITOperations.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebKit::populateJITOperations): * Shared/WebKitJITOperations.h: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. * Sources.txt: * WebKit.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: * History/WebBackForwardList.mm: (+[WebBackForwardList initialize]): * History/WebHistoryItem.mm: (+[WebHistoryItem initialize]): * Misc/WebCache.mm: (+[WebCache initialize]): * Misc/WebElementDictionary.mm: (+[WebElementDictionary initialize]): * Misc/WebIconDatabase.mm: * Misc/WebStringTruncator.mm: (+[WebStringTruncator initialize]): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (+[WebHostedNetscapePluginView initialize]): * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage initialize]): * Plugins/WebNetscapePluginView.mm: (+[WebNetscapePluginView initialize]): * WebCoreSupport/WebEditorClient.mm: (+[WebUndoStep initialize]): * WebCoreSupport/WebFrameLoaderClient.mm: (+[WebFramePolicyListener initialize]): * WebView/WebArchive.mm: (+[WebArchivePrivate initialize]): * WebView/WebDataSource.mm: (+[WebDataSource initialize]): * WebView/WebHTMLView.mm: (+[WebHTMLViewPrivate initialize]): (+[WebHTMLView initialize]): * WebView/WebPreferences.mm: (+[WebPreferences initialize]): * WebView/WebResource.mm: (+[WebResourcePrivate initialize]): * WebView/WebTextIterator.mm: (+[WebTextIteratorPrivate initialize]): * WebView/WebView.mm: (+[WebView initialize]): * WebView/WebViewData.mm: (+[WebViewPrivate initialize]): Source/WebKitLegacy/win: * WebKitClassFactory.cpp: (WebKitClassFactory::WebKitClassFactory): * WebView.cpp: (WebView::WebView): Source/WTF: * wtf/PlatformCallingConventions.h: * wtf/PlatformEnable.h: Canonical link: https://commits.webkit.org/230049@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-03 23:51:12 +00:00
namespace DOMJIT {
JSC_DEFINE_JIT_OPERATION(operationToJSElement, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
{
ASSERT(result);
ASSERT(globalObject);
JSC::VM& vm = globalObject->vm();
JSC::CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return DOMJIT::toWrapperSlowImpl<Element>(globalObject, result);
}
JSC_DEFINE_JIT_OPERATION(operationToJSHTMLElement, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
{
ASSERT(result);
ASSERT(globalObject);
JSC::VM& vm = globalObject->vm();
JSC::CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return DOMJIT::toWrapperSlowImpl<HTMLElement>(globalObject, result);
}
JSC_DEFINE_JIT_OPERATION(operationToJSDocument, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
{
ASSERT(result);
ASSERT(globalObject);
JSC::VM& vm = globalObject->vm();
JSC::CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return DOMJIT::toWrapperSlowImpl<Document>(globalObject, result);
}
JSC_DEFINE_JIT_OPERATION(operationToJSNode, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
{
ASSERT(result);
ASSERT(globalObject);
JSC::VM& vm = globalObject->vm();
JSC::CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return DOMJIT::toWrapperSlowImpl<Node>(globalObject, result);
}
JSC_DEFINE_JIT_OPERATION(operationToJSContainerNode, JSC::EncodedJSValue, (JSC::JSGlobalObject* globalObject, void* result))
{
ASSERT(result);
ASSERT(globalObject);
JSC::VM& vm = globalObject->vm();
JSC::CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return DOMJIT::toWrapperSlowImpl<ContainerNode>(globalObject, result);
}
} } // namespace WebCore::DOMJIT
IGNORE_WARNINGS_END
[DOMJIT] Implement Document::documentElement https://bugs.webkit.org/show_bug.cgi?id=164113 Reviewed by Sam Weinig. Source/WebCore: Test: js/dom/domjit-accessor-document-element.html This patch implements document.documentElement DOMJIT accessor. Similar to ownerDocument accessor, the way to access to document.documentElement from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing functionality: using documentElementMemoryOffset(). document.documentElement is frequently called in jQuery. Especially, every time we call jQuery.attr(), this is called. To implement Document accessor, we clean up some code in DOMJITHelpers. We create the cpp file for DOMJITHelpers and move some helpers to it. And we also implement DOMJIT::checkDOM<DOMInterface> for convenience. It returns appropriate CheckDOM patchpoint implementation. This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot): * dom/Document.idl: * domjit/DOMJITAbstractHeapRepository.h: * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail): (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail): (WebCore::DOMJIT::checkDOM): * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h. (WebCore::DOMJIT::loadDocument): (WebCore::DOMJIT::loadDocumentElement): * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::toWrapperSlow): (WebCore::DOMJIT::loadDocument): Deleted. * domjit/JSDocumentDOMJIT.cpp: Added. (WebCore::DocumentDocumentElementDOMJIT::checkDOM): (WebCore::DocumentDocumentElementDOMJIT::callDOM): * domjit/JSNodeDOMJIT.cpp: (WebCore::createCallDOMForOffsetAccess): (WebCore::NodeFirstChildDOMJIT::checkDOM): (WebCore::NodeLastChildDOMJIT::checkDOM): (WebCore::NodeNextSiblingDOMJIT::checkDOM): (WebCore::NodePreviousSiblingDOMJIT::checkDOM): (WebCore::NodeParentNodeDOMJIT::checkDOM): (WebCore::NodeNodeTypeDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): (WebCore::NodeOwnerDocumentDOMJIT::callDOM): (WebCore::toWrapperSlow): Deleted. (WebCore::checkNode): Deleted. LayoutTests: * js/dom/domjit-accessor-document-element-changed-expected.txt: Added. * js/dom/domjit-accessor-document-element-changed.html: Added. * js/dom/domjit-accessor-document-element-expected.txt: Added. * js/dom/domjit-accessor-document-element.html: Added. Canonical link: https://commits.webkit.org/181855@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-28 21:33:30 +00:00
#endif // ENABLE(JIT)