WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-163005-20161007141446.patch (text/plain), 39.47 KB, created by
Yusuke Suzuki
on 2016-10-06 22:18:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2016-10-06 22:18:01 PDT
Size:
39.47 KB
patch
obsolete
>Subversion Revision: 206899 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index eecc79e4e762abfb2397f14900ab78d61fff39fc..ef0f76dfa5cacb0931e4fb4f922dec353c0eb229 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,5 +1,23 @@ > 2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com> > >+ [DOMJIT] Implement Node accessors in DOMJIT >+ https://bugs.webkit.org/show_bug.cgi?id=163005 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * dfg/DFGSpeculativeJIT.h: >+ (JSC::DFG::SpeculativeJIT::callOperation): >+ * domjit/DOMJITSlowPathCalls.h: >+ * heap/WeakImpl.h: >+ (JSC::WeakImpl::offsetOfJSValue): >+ (JSC::WeakImpl::offsetOfWeakHandleOwner): >+ * jit/AssemblyHelpers.h: >+ (JSC::AssemblyHelpers::boxCell): >+ (JSC::AssemblyHelpers::boxInt32): Deleted. >+ * jit/JITOperations.h: >+ >+2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com> >+ > [DOMJIT] Support slow path call > https://bugs.webkit.org/show_bug.cgi?id=162978 > >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 3a22e5438793b8f658f3aee9c57aaf68ae76f43c..983121f15d4a3efd713ab622ae597e9aab7159d8 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,12 @@ >+2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [DOMJIT] Implement Node accessors in DOMJIT >+ https://bugs.webkit.org/show_bug.cgi?id=163005 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/StdLibExtras.h: >+ > 2016-10-06 Brent Fulgham <bfulgham@apple.com> > > [Win][Direct2D] Add Direct2D CMake rules >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 83803e91c0e056ca789502a6bd61a584f29b2e74..6bf8efaf5c2880f2862977222942a423d9189f62 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,53 @@ >+2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [DOMJIT] Implement Node accessors in DOMJIT >+ https://bugs.webkit.org/show_bug.cgi?id=163005 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * CMakeLists.txt: >+ * ForwardingHeaders/domjit/DOMJITPatchpoint.h: Added. >+ * ForwardingHeaders/domjit/DOMJITPatchpointParams.h: Added. >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/JSDOMGlobalObject.h: >+ * bindings/js/JSDOMWrapper.h: >+ (WebCore::JSDOMWrapper::offsetOfWrapped): >+ (WebCore::JSDOMWrapper::wrapped): Deleted. >+ * bindings/js/ScriptWrappable.h: >+ (WebCore::ScriptWrappable::offsetOfWrapper): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GetJSCAttributesForAttribute): >+ (GenerateHeader): >+ (GeneratePropertiesHashTable): >+ (GenerateImplementation): >+ (GenerateHashTableValueArray): >+ * bindings/scripts/IDLAttributes.txt: >+ * dom/ContainerNode.h: >+ (WebCore::ContainerNode::lastChildMemoryOffset): >+ (WebCore::ContainerNode::lastChild): Deleted. >+ * dom/Node.h: >+ (WebCore::Node::flagIsContainer): >+ (WebCore::Node::flagIsText): Deleted. >+ * dom/Node.idl: >+ * domjit/DOMJITHelpers.h: Added. >+ (WebCore::DOMJITHelpers::branchIfNotWorldIsNormal): >+ (WebCore::DOMJITHelpers::branchIfNotWeakIsLive): >+ (WebCore::DOMJITHelpers::tryLookUpWrapperCache): >+ (WebCore::DOMJITHelpers::wrapResult): >+ * domjit/JSNodeDOMJIT.cpp: Added. >+ (WebCore::createCallDOMForOffsetAccess): >+ (WebCore::checkNode): >+ (WebCore::NodeFirstChildDOMJIT::checkDOM): >+ (WebCore::NodeFirstChildDOMJIT::callDOM): >+ (WebCore::NodeLastChildDOMJIT::checkDOM): >+ (WebCore::NodeLastChildDOMJIT::callDOM): >+ (WebCore::NodeNextSiblingDOMJIT::checkDOM): >+ (WebCore::NodeNextSiblingDOMJIT::callDOM): >+ (WebCore::NodePreviousSiblingDOMJIT::checkDOM): >+ (WebCore::NodePreviousSiblingDOMJIT::callDOM): >+ (WebCore::NodeParentNodeDOMJIT::checkDOM): >+ (WebCore::NodeParentNodeDOMJIT::callDOM): >+ > 2016-10-06 Myles C. Maxfield <mmaxfield@apple.com> > > Variation fonts don't affect glyph advances >diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >index 4e61273466f4fdc128af142ca6178516d6105623..638787f1ac712bbce93ebc2384ed8819275d4ce0 100644 >--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h >@@ -1639,6 +1639,11 @@ class SpeculativeJIT { > m_jit.setupArgumentsWithExecState(arg1, arg2); > return appendCallSetResult(operation, result); > } >+ JITCompiler::Call callOperation(J_JITOperation_EGP operation, GPRReg result, GPRReg arg1, GPRReg arg2) >+ { >+ m_jit.setupArgumentsWithExecState(arg1, arg2); >+ return appendCallSetResult(operation, result); >+ } > JITCompiler::Call callOperation(J_JITOperation_EJJ operation, GPRReg result, GPRReg arg1, GPRReg arg2) > { > m_jit.setupArgumentsWithExecState(arg1, arg2); >@@ -1894,6 +1899,11 @@ class SpeculativeJIT { > m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(pointer)); > return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR()); > } >+ JITCompiler::Call callOperation(J_JITOperation_EGP operation, JSValueRegs result, GPRReg arg1, GPRReg arg2) >+ { >+ m_jit.setupArgumentsWithExecState(arg1, arg2); >+ return appendCallSetResult(operation, result.payloadGPR(), result.tagGPR()); >+ } > JITCompiler::Call callOperation(J_JITOperation_EP operation, JSValueRegs result, GPRReg arg1) > { > m_jit.setupArgumentsWithExecState(arg1); >diff --git a/Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h b/Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h >index 81b905737e6488fb955da0c9cca2b3690f5b5ce0..cb22b1f33260f121acb186a322512345ca14790e 100644 >--- a/Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h >+++ b/Source/JavaScriptCore/domjit/DOMJITSlowPathCalls.h >@@ -30,5 +30,6 @@ > // macro(OperationType, ArgType1, ArgType2, ...) > #define DOMJIT_SLOW_PATH_CALLS(macro) \ > macro(J_JITOperation_EP, JSValueRegs, GPRReg) \ >+ macro(J_JITOperation_EGP, JSValueRegs, GPRReg, GPRReg) \ > > #endif >diff --git a/Source/JavaScriptCore/heap/WeakImpl.h b/Source/JavaScriptCore/heap/WeakImpl.h >index d817b728b66f9e13ccd0890d416e271f26727f77..3f6ffbfa43510b5585483b4afae43c0e16022302 100644 >--- a/Source/JavaScriptCore/heap/WeakImpl.h >+++ b/Source/JavaScriptCore/heap/WeakImpl.h >@@ -51,7 +51,9 @@ class WeakImpl { > void setState(State); > > const JSValue& jsValue(); >+ static ptrdiff_t offsetOfJSValue() { return OBJECT_OFFSETOF(WeakImpl, m_jsValue); } > WeakHandleOwner* weakHandleOwner(); >+ static ptrdiff_t offsetOfWeakHandleOwner() { return OBJECT_OFFSETOF(WeakImpl, m_weakHandleOwner); } > void* context(); > > static WeakImpl* asWeakImpl(JSValue*); >diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h >index c6d8bc3edec5e234cefe7278dbea584a27b73d6c..a99f98fb5747528fbc4f84de878e25db7a51409e 100644 >--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h >+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h >@@ -1204,6 +1204,16 @@ class AssemblyHelpers : public MacroAssembler { > move(TrustedImm32(JSValue::Int32Tag), boxedRegs.tagGPR()); > #endif > } >+ >+ void boxCell(GPRReg cellGPR, JSValueRegs boxedRegs) >+ { >+#if USE(JSVALUE64) >+ move(cellGPR, boxedRegs.gpr()); >+#else >+ move(cellGPR, boxedRegs.payloadGPR()); >+ move(TrustedImm32(JSValue::CellTag), boxedRegs.tagGPR()); >+#endif >+ } > > void callExceptionFuzz(); > >diff --git a/Source/JavaScriptCore/jit/JITOperations.h b/Source/JavaScriptCore/jit/JITOperations.h >index 5810e2d72f6b986a00da0af0cef97a028ff36d18..338a40ac05c63a204fc7228b15e45d8610fc261d 100644 >--- a/Source/JavaScriptCore/jit/JITOperations.h >+++ b/Source/JavaScriptCore/jit/JITOperations.h >@@ -155,6 +155,7 @@ typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EJssZ)(ExecState*, JSStrin > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EJssReo)(ExecState*, JSString*, RegExpObject*); > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EJssReoJss)(ExecState*, JSString*, RegExpObject*, JSString*); > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EJP)(ExecState*, EncodedJSValue, void*); >+typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EGP)(ExecState*, JSGlobalObject*, void*); > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EP)(ExecState*, void*); > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EPP)(ExecState*, void*, void*); > typedef EncodedJSValue (JIT_OPERATION *J_JITOperation_EPS)(ExecState*, void*, size_t); >diff --git a/Source/WTF/wtf/StdLibExtras.h b/Source/WTF/wtf/StdLibExtras.h >index ba049fa87dfa1c9e3fa58eb4b0d323cfd696b521..5f388eb4f0f254767229f95b396a15d7f6f03182 100644 >--- a/Source/WTF/wtf/StdLibExtras.h >+++ b/Source/WTF/wtf/StdLibExtras.h >@@ -68,6 +68,8 @@ > // NULL can cause compiler problems, especially in cases of multiple inheritance. > #define OBJECT_OFFSETOF(class, field) (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<class*>(0x4000)->field)) - 0x4000) > >+#define CAST_OFFSET(from, to) (reinterpret_cast<uintptr_t>(static_cast<to>((reinterpret_cast<from>(0x4000)))) - 0x4000) >+ > // STRINGIZE: Can convert any value to quoted string, even expandable macros > #define STRINGIZE(exp) #exp > #define STRINGIZE_VALUE_OF(exp) STRINGIZE(exp) >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 1c47cf7dd82cc1b9fafa56456bd44e84d0aad11b..52b9a14345f91f4ad4b72339217709202559f0e0 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -48,6 +48,7 @@ set(WebCore_INCLUDE_DIRECTORIES > "${WEBCORE_DIR}/cssjit" > "${WEBCORE_DIR}/dom" > "${WEBCORE_DIR}/dom/default" >+ "${WEBCORE_DIR}/domjit" > "${WEBCORE_DIR}/editing" > "${WEBCORE_DIR}/fileapi" > "${WEBCORE_DIR}/history" >@@ -1528,6 +1529,8 @@ set(WebCore_SOURCES > > dom/default/PlatformMessagePortChannel.cpp > >+ domjit/JSNodeDOMJIT.cpp >+ > editing/AlternativeTextController.cpp > editing/AppendNodeCommand.cpp > editing/ApplyBlockElementCommand.cpp >diff --git a/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h b/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h >new file mode 100644 >index 0000000000000000000000000000000000000000..bf90a128f48a6686c643c721bb9f6a52cfea3f55 >--- /dev/null >+++ b/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h >@@ -0,0 +1,4 @@ >+#ifndef WebCore_FWD_DOMJITPatchpoint_h >+#define WebCore_FWD_DOMJITPatchpoint_h >+#include <JavaScriptCore/DOMJITPatchpoint.h> >+#endif >diff --git a/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h b/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f8f6b712d16562c71a0546fc2333c44ae8e57158 >--- /dev/null >+++ b/Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h >@@ -0,0 +1,4 @@ >+#ifndef WebCore_FWD_DOMJITPatchpointParams_h >+#define WebCore_FWD_DOMJITPatchpointParams_h >+#include <JavaScriptCore/DOMJITPatchpointParams.h> >+#endif >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index b49eef495447f9718e49952648212c3f11128a79..691dc821ac71ec6e14b54a3d276c035936fd5b0c 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -6133,6 +6133,8 @@ > E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; }; > E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */; }; > E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; }; >+ E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3AFA9641DA6E908002861BD /* JSNodeDOMJIT.cpp */; }; >+ E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = E3150EA51DA7218D00194012 /* DOMJITHelpers.h */; }; > E38838981BAD145F00D62EE3 /* ScriptModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */; }; > E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */; }; > E3B2F0EB1D7F4C9D00B0C9D1 /* LoadableClassicScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3B2F0E31D7F35EC00B0C9D1 /* LoadableClassicScript.cpp */; }; >@@ -13752,8 +13754,10 @@ > E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCryptoCustom.cpp; sourceTree = "<group>"; }; > E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistry.cpp; sourceTree = "<group>"; }; > E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = "<group>"; }; >+ E3150EA51DA7218D00194012 /* DOMJITHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITHelpers.h; sourceTree = "<group>"; }; > E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptModuleLoader.cpp; sourceTree = "<group>"; }; > E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptModuleLoader.h; sourceTree = "<group>"; }; >+ E3AFA9641DA6E908002861BD /* JSNodeDOMJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeDOMJIT.cpp; sourceTree = "<group>"; }; > E3B2F0E31D7F35EC00B0C9D1 /* LoadableClassicScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadableClassicScript.cpp; sourceTree = "<group>"; }; > E3B2F0E41D7F35EC00B0C9D1 /* LoadableClassicScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadableClassicScript.h; sourceTree = "<group>"; }; > E3B2F0E71D7F35EC00B0C9D1 /* LoadableScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadableScript.h; sourceTree = "<group>"; }; >@@ -14860,6 +14864,7 @@ > F523D18402DE42E8018635CA /* css */, > 26B9998D1803ADFA00D01121 /* cssjit */, > F523D32402DE4478018635CA /* dom */, >+ E3AFA9631DA6E8AF002861BD /* domjit */, > 93309D86099E64910056E581 /* editing */, > 976D6C57122B8A18001FD1F7 /* fileapi */, > 51741D080B07257000ED442C /* history */, >@@ -22282,6 +22287,15 @@ > name = Crypto; > sourceTree = "<group>"; > }; >+ E3AFA9631DA6E8AF002861BD /* domjit */ = { >+ isa = PBXGroup; >+ children = ( >+ E3150EA51DA7218D00194012 /* DOMJITHelpers.h */, >+ E3AFA9641DA6E908002861BD /* JSNodeDOMJIT.cpp */, >+ ); >+ path = domjit; >+ sourceTree = "<group>"; >+ }; > E46E97860DAAD61B0071E894 /* animation */ = { > isa = PBXGroup; > children = ( >@@ -24740,6 +24754,7 @@ > A871DC240A15205700B12A68 /* HTMLMetaElement.h in Headers */, > A454424B119B3661009BE912 /* HTMLMeterElement.h in Headers */, > A8CFF7A70A156978000A4234 /* HTMLModElement.h in Headers */, >+ E3150EA71DA7219300194012 /* DOMJITHelpers.h in Headers */, > A8DF3FD4097FA0FC0052981B /* HTMLNameCollection.h in Headers */, > A871D45A0A127CBC00B12A68 /* HTMLObjectElement.h in Headers */, > A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */, >@@ -28645,6 +28660,7 @@ > BCC065870F3CE2A700CD2D87 /* JSClientRect.cpp in Sources */, > 46A58AC51D46B3FA00432036 /* JSClientRectCustom.cpp in Sources */, > BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */, >+ E3150EA61DA7219000194012 /* JSNodeDOMJIT.cpp in Sources */, > 51FB5505113E3E9100821176 /* JSCloseEvent.cpp in Sources */, > A584FE3B1864E2D800843B10 /* JSCommandLineAPIHost.cpp in Sources */, > A584FE381864DAC100843B10 /* JSCommandLineAPIHostCustom.cpp in Sources */, >diff --git a/Source/WebCore/bindings/js/JSDOMGlobalObject.h b/Source/WebCore/bindings/js/JSDOMGlobalObject.h >index d40c43f63d57e7e5970c7e62efa856ae64e32f29..a01bf568c5fe3013cc19499d52a28ebc1a78c94e 100644 >--- a/Source/WebCore/bindings/js/JSDOMGlobalObject.h >+++ b/Source/WebCore/bindings/js/JSDOMGlobalObject.h >@@ -72,6 +72,7 @@ namespace WebCore { > > DOMWrapperWorld& world() { return m_world.get(); } > bool worldIsNormal() const { return m_worldIsNormal; } >+ static ptrdiff_t offsetOfWorldIsNormal() { return OBJECT_OFFSETOF(JSDOMGlobalObject, m_worldIsNormal); } > > JSBuiltinInternalFunctions& builtinInternalFunctions() { return m_builtinInternalFunctions; } > >@@ -95,7 +96,7 @@ namespace WebCore { > > Event* m_currentEvent; > Ref<DOMWrapperWorld> m_world; >- bool m_worldIsNormal; >+ uint8_t m_worldIsNormal; > > private: > void addBuiltinGlobals(JSC::VM&); >diff --git a/Source/WebCore/bindings/js/JSDOMWrapper.h b/Source/WebCore/bindings/js/JSDOMWrapper.h >index 62510cdc25aebdaff9ba235075bc9744473e98ca..009f6df07eeb11620018b8325b90ec5227311fdc 100644 >--- a/Source/WebCore/bindings/js/JSDOMWrapper.h >+++ b/Source/WebCore/bindings/js/JSDOMWrapper.h >@@ -59,6 +59,7 @@ template<typename ImplementationClass> class JSDOMWrapper : public JSDOMObject { > static constexpr bool isDOMWrapper = true; > > ImplementationClass& wrapped() const { return const_cast<ImplementationClass&>(m_wrapped.get()); } >+ static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSDOMWrapper<ImplementationClass>, m_wrapped); } > > protected: > JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject& globalObject, Ref<ImplementationClass>&& impl) >diff --git a/Source/WebCore/bindings/js/ScriptWrappable.h b/Source/WebCore/bindings/js/ScriptWrappable.h >index 5d9326114aa6f0c1d4f0b7bce164a1238e26a90c..5375f6687d1caf0d075fcb25cf810d56d198e1d2 100644 >--- a/Source/WebCore/bindings/js/ScriptWrappable.h >+++ b/Source/WebCore/bindings/js/ScriptWrappable.h >@@ -48,6 +48,9 @@ class ScriptWrappable { > void setWrapper(JSDOMObject*, JSC::WeakHandleOwner*, void*); > void clearWrapper(JSDOMObject*); > >+ template<typename Derived> >+ static ptrdiff_t offsetOfWrapper() { return CAST_OFFSET(Derived*, ScriptWrappable*) + OBJECT_OFFSETOF(ScriptWrappable, m_wrapper); } >+ > protected: > ~ScriptWrappable() { } > >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index fb866c36a84f11e6ef419ce114f287dfc45418f1..e19c21d29374a9d605cda3a2aeb8f7f9180f1d94 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -619,6 +619,7 @@ sub GetJSCAttributesForAttribute > push(@specials, "DontEnum") if ($attribute->signature->extendedAttributes->{NotEnumerable} || $is_global_constructor); > push(@specials, "ReadOnly") if IsReadonly($attribute); > push(@specials, "CustomAccessor") unless $is_global_constructor or IsJSBuiltin($interface, $attribute); >+ push(@specials, "DOMJITAttribute") if $attribute->signature->extendedAttributes->{"DOMJIT"}; > push(@specials, "Accessor | Builtin") if IsJSBuiltin($interface, $attribute); > return (@specials > 0) ? join(" | ", @specials) : "0"; > } >@@ -1408,6 +1409,8 @@ sub GenerateHeader > my $hasForwardDeclaringFunctions = 0; > my $hasForwardDeclaringAttributes = 0; > >+ my $hasDOMJITAttributes = 0; >+ > # Attribute and function enums > if ($numAttributes > 0) { > foreach (@{$interface->attributes}) { >@@ -1422,6 +1425,7 @@ sub GenerateHeader > $needsVisitChildren = 1; > push(@headerContent, "#endif\n") if $conditionalString; > } >+ $hasDOMJITAttributes = 1 if $attribute->signature->extendedAttributes->{"DOMJIT"}; > > $hasForwardDeclaringAttributes = 1 if $attribute->signature->extendedAttributes->{ForwardDeclareInHeader}; > } >@@ -1629,6 +1633,29 @@ sub GenerateHeader > } > } > >+ if ($hasDOMJITAttributes) { >+ $headerIncludes{"<domjit/DOMJITGetterSetter.h>"} = 1; >+ push(@headerContent,"// DOMJIT emitters for attributes\n\n"); >+ foreach my $attribute (@{$interface->attributes}) { >+ next unless $attribute->signature->extendedAttributes->{"DOMJIT"}; >+ >+ my $interfaceName = $interface->name; >+ my $className = $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name); >+ my $domJITClassName = $className . "DOMJIT"; >+ >+ push(@headerContent, "JSC::DOMJIT::GetterSetter* domJITGetterSetterFor$className(void);\n"); >+ >+ push(@headerContent, "class $domJITClassName : public JSC::DOMJIT::GetterSetter {\n"); >+ push(@headerContent, "public:\n"); >+ push(@headerContent, " $domJITClassName();\n"); >+ push(@headerContent, "#if ENABLE(JIT)\n"); >+ push(@headerContent, " Ref<JSC::DOMJIT::Patchpoint> checkDOM() override;\n"); >+ push(@headerContent, " Ref<JSC::DOMJIT::Patchpoint> callDOM() override;\n"); >+ push(@headerContent, "#endif\n"); >+ push(@headerContent, "};\n\n"); >+ } >+ } >+ > if (HasCustomConstructor($interface)) { > push(@headerContent, "// Custom constructor\n"); > push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState&);\n\n"); >@@ -1708,14 +1735,19 @@ sub GeneratePropertiesHashTable > my $special = GetJSCAttributesForAttribute($interface, $attribute); > push(@$hashSpecials, $special); > >- my $getter = GetAttributeGetterName($interface, $className, $attribute); >- push(@$hashValue1, $getter); >- >- if (IsReadonly($attribute)) { >+ if ($attribute->signature->extendedAttributes->{"DOMJIT"}) { >+ push(@$hashValue1, "domJITGetterSetterFor" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name)); > push(@$hashValue2, "0"); > } else { >- my $setter = GetAttributeSetterName($interface, $className, $attribute); >- push(@$hashValue2, $setter); >+ my $getter = GetAttributeGetterName($interface, $className, $attribute); >+ push(@$hashValue1, $getter); >+ >+ if (IsReadonly($attribute)) { >+ push(@$hashValue2, "0"); >+ } else { >+ my $setter = GetAttributeSetterName($interface, $className, $attribute); >+ push(@$hashValue2, $setter); >+ } > } > > my $conditional = $attribute->signature->extendedAttributes->{Conditional}; >@@ -2496,17 +2528,23 @@ sub GenerateImplementation > my @specials = (); > push(@specials, "DontDelete") unless $attribute->signature->extendedAttributes->{Deletable}; > push(@specials, "ReadOnly") if IsReadonly($attribute); >+ push(@specials, "DOMJITAttribute") if $attribute->signature->extendedAttributes->{"DOMJIT"}; > my $special = (@specials > 0) ? join(" | ", @specials) : "0"; > push(@hashSpecials, $special); > >- my $getter = GetAttributeGetterName($interface, $className, $attribute); >- push(@hashValue1, $getter); >- >- if (IsReadonly($attribute)) { >+ if ($attribute->signature->extendedAttributes->{"DOMJIT"}) { >+ push(@hashValue1, "domJITGetterSetterFor" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name)); > push(@hashValue2, "0"); > } else { >- my $setter = GetAttributeSetterName($interface, $className, $attribute); >- push(@hashValue2, $setter); >+ my $getter = GetAttributeGetterName($interface, $className, $attribute); >+ push(@hashValue1, $getter); >+ >+ if (IsReadonly($attribute)) { >+ push(@hashValue2, "0"); >+ } else { >+ my $setter = GetAttributeSetterName($interface, $className, $attribute); >+ push(@hashValue2, $setter); >+ } > } > > my $conditional = $attribute->signature->extendedAttributes->{Conditional}; >@@ -3064,6 +3102,26 @@ sub GenerateImplementation > > push(@implContent, "}\n\n"); > >+ if ($attribute->signature->extendedAttributes->{"DOMJIT"}) { >+ $implIncludes{"<wtf/NeverDestroyed.h>"} = 1; >+ my $interfaceName = $interface->name; >+ my $attributeName = $attribute->signature->name; >+ my $generatorName = $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name); >+ my $domJITClassName = $generatorName . "DOMJIT"; >+ my $getter = GetAttributeGetterName($interface, $generatorName, $attribute); >+ my $setter = IsReadonly($attribute) ? "nullptr" : GetAttributeSetterName($interface, $generatorName, $attribute); >+ push(@implContent, "$domJITClassName::$domJITClassName()\n"); >+ push(@implContent, " : JSC::DOMJIT::GetterSetter($getter, $setter, ${className}::info())\n"); >+ push(@implContent, "{\n"); >+ push(@implContent, "}\n\n"); >+ >+ push(@implContent, "JSC::DOMJIT::GetterSetter* domJITGetterSetterFor" . $generatorName . "()\n"); >+ push(@implContent, "{\n"); >+ push(@implContent, " static NeverDestroyed<$domJITClassName> compiler;\n"); >+ push(@implContent, " return &compiler.get();\n"); >+ push(@implContent, "}\n\n"); >+ } >+ > push(@implContent, "#endif\n") if $attributeConditionalString; > > push(@implContent, "\n"); >@@ -5037,12 +5095,14 @@ sub GenerateHashTableValueArray > $firstTargetType = "static_cast<BuiltinGenerator>"; > } elsif ("@$specials[$i]" =~ m/ConstantInteger/) { > $firstTargetType = ""; >+ } elsif ("@$specials[$i]" =~ m/DOMJITAttribute/) { >+ $firstTargetType = "static_cast<DOMJITGetterSetterGenerator>"; > } else { > $firstTargetType = "static_cast<PropertySlot::GetValueFunc>"; > $secondTargetType = "static_cast<PutPropertySlot::PutValueFunc>"; > $hasSetter = "true"; > } >- if ("@$specials[$i]" =~ m/ConstantInteger/) { >+ if ("@$specials[$i]" =~ m/ConstantInteger|DOMJITAttribute/) { > push(@implContent, " { \"$key\", @$specials[$i], NoIntrinsic, { (long long)" . $firstTargetType . "(@$value1[$i]) } },\n"); > } else { > push(@implContent, " { \"$key\", @$specials[$i], NoIntrinsic, { (intptr_t)" . $firstTargetType . "(@$value1[$i]), (intptr_t) " . $secondTargetType . "(@$value2[$i]) } },\n"); >diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt >index 3c24a5421aca32cd726b98b7d99c8d8306ac6f6e..19cd4bb13d7c6fb8cb8295110c43b4cee099b59a 100644 >--- a/Source/WebCore/bindings/scripts/IDLAttributes.txt >+++ b/Source/WebCore/bindings/scripts/IDLAttributes.txt >@@ -54,6 +54,7 @@ CustomReturn > CustomSetPrototype > CustomSetter > CustomToJSObject >+DOMJIT > Deletable > DoNotCheckConstants > DoNotCheckSecurity >diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h >index 9ca7a18351aa91abfad2e4b23381cd1170353e89..5ac2a7cb0fe636c40c77c9c47106a8e9d40f5c23 100644 >--- a/Source/WebCore/dom/ContainerNode.h >+++ b/Source/WebCore/dom/ContainerNode.h >@@ -41,6 +41,7 @@ class ContainerNode : public Node { > Node* firstChild() const { return m_firstChild; } > static ptrdiff_t firstChildMemoryOffset() { return OBJECT_OFFSETOF(ContainerNode, m_firstChild); } > Node* lastChild() const { return m_lastChild; } >+ static ptrdiff_t lastChildMemoryOffset() { return OBJECT_OFFSETOF(ContainerNode, m_lastChild); } > bool hasChildNodes() const { return m_firstChild; } > bool hasOneChild() const { return m_firstChild && !m_firstChild->nextSibling(); } > >diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h >index 9664df77152b3a0ac9558deec166e9c877616ec7..6a5d2a58d2cfd9a6171ee0397e5ca4dfe33521b5 100644 >--- a/Source/WebCore/dom/Node.h >+++ b/Source/WebCore/dom/Node.h >@@ -559,10 +559,11 @@ class Node : public EventTarget { > void updateAncestorConnectedSubframeCountForRemoval() const; > void updateAncestorConnectedSubframeCountForInsertion() const; > >-#if ENABLE(CSS_SELECTOR_JIT) >+#if ENABLE(JIT) > static ptrdiff_t nodeFlagsMemoryOffset() { return OBJECT_OFFSETOF(Node, m_nodeFlags); } > static ptrdiff_t rareDataMemoryOffset() { return OBJECT_OFFSETOF(Node, m_data.m_rareData); } > static int32_t flagIsText() { return IsTextFlag; } >+ static int32_t flagIsContainer() { return IsContainerFlag; } > static int32_t flagIsElement() { return IsElementFlag; } > static int32_t flagIsHTML() { return IsHTMLFlag; } > static int32_t flagIsLink() { return IsLinkFlag; } >@@ -574,7 +575,7 @@ class Node : public EventTarget { > > static int32_t flagAffectsNextSiblingElementStyle() { return AffectsNextSiblingElementStyle; } > static int32_t flagStyleIsAffectedByPreviousSibling() { return StyleIsAffectedByPreviousSibling; } >-#endif // ENABLE(CSS_SELECTOR_JIT) >+#endif // ENABLE(JIT) > > protected: > enum NodeFlags { >diff --git a/Source/WebCore/dom/Node.idl b/Source/WebCore/dom/Node.idl >index 6b77e33458394c765f406caf80ae5fcfa1db1233..6f2742f83a3027b061d5f02d09ecb4a5266cadaf 100644 >--- a/Source/WebCore/dom/Node.idl >+++ b/Source/WebCore/dom/Node.idl >@@ -47,12 +47,12 @@ > [SetterMayThrowLegacyException] attribute DOMString? nodeValue; > > readonly attribute unsigned short nodeType; >- readonly attribute Node? parentNode; >+ [DOMJIT] readonly attribute Node? parentNode; > readonly attribute NodeList childNodes; >- readonly attribute Node? firstChild; >- readonly attribute Node? lastChild; >- readonly attribute Node? previousSibling; >- readonly attribute Node? nextSibling; >+ [DOMJIT] readonly attribute Node? firstChild; >+ [DOMJIT] readonly attribute Node? lastChild; >+ [DOMJIT] readonly attribute Node? previousSibling; >+ [DOMJIT] readonly attribute Node? nextSibling; > readonly attribute Document? ownerDocument; > > [Custom, MayThrowLegacyException] Node insertBefore([CustomReturn] Node newChild, Node? refChild); >diff --git a/Source/WebCore/domjit/DOMJITHelpers.h b/Source/WebCore/domjit/DOMJITHelpers.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4c1c428ac6d2842bdd67b0287e2c9c36b643aa9d >--- /dev/null >+++ b/Source/WebCore/domjit/DOMJITHelpers.h >@@ -0,0 +1,76 @@ >+/* >+ * 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. >+ * >+ */ >+ >+#pragma once >+ >+#include <domjit/DOMJITPatchpoint.h> >+#include <domjit/DOMJITPatchpointParams.h> >+ >+#if ENABLE(JIT) >+ >+namespace WebCore { >+namespace DOMJITHelpers { >+ >+using JSC::CCallHelpers; >+using JSC::GPRReg; >+using JSC::JSValueRegs; >+ >+inline CCallHelpers::Jump branchIfNotWorldIsNormal(CCallHelpers& jit, GPRReg globalObject) >+{ >+ return jit.branchTest8(CCallHelpers::Zero, CCallHelpers::Address(globalObject, JSDOMGlobalObject::offsetOfWorldIsNormal())); >+} >+ >+inline CCallHelpers::Jump branchIfNotWeakIsLive(CCallHelpers& jit, GPRReg weakImpl) >+{ >+ return jit.branchTestPtr(CCallHelpers::NonZero, CCallHelpers::Address(weakImpl, JSC::WeakImpl::offsetOfWeakHandleOwner()), CCallHelpers::TrustedImm32(JSC::WeakImpl::StateMask)); >+} >+ >+template<typename WrappedType> >+void tryLookUpWrapperCache(CCallHelpers& jit, CCallHelpers::JumpList& failureCases, GPRReg wrapped, GPRReg resultGPR) >+{ >+ jit.loadPtr(CCallHelpers::Address(wrapped, ScriptWrappable::offsetOfWrapper<WrappedType>()), resultGPR); >+ failureCases.append(jit.branchTestPtr(CCallHelpers::Zero, resultGPR)); >+ failureCases.append(branchIfNotWeakIsLive(jit, resultGPR)); >+ jit.loadPtr(CCallHelpers::Address(resultGPR, JSC::WeakImpl::offsetOfJSValue() + JSC::JSValue::offsetOfPayload()), resultGPR); >+ failureCases.append(jit.branchTestPtr(CCallHelpers::Zero, resultGPR)); >+} >+ >+template<typename WrappedType> >+void wrapResult(CCallHelpers& jit, const JSC::DOMJIT::PatchpointParams& params, GPRReg wrapped, GPRReg globalObject, JSValueRegs result) >+{ >+ CCallHelpers::JumpList slowCases; >+ slowCases.append(branchIfNotWorldIsNormal(jit, globalObject)); >+ tryLookUpWrapperCache<WrappedType>(jit, slowCases, wrapped, result.payloadGPR()); >+ jit.boxCell(result.payloadGPR(), result); >+ >+ params.addSlowPathCall(slowCases, jit, static_cast<JSC::EncodedJSValue(*)(JSC::ExecState*, JSC::JSGlobalObject*, void*)>([](JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, void* wrapped) -> JSC::EncodedJSValue { >+ return JSC::JSValue::encode(toJS(exec, static_cast<JSDOMGlobalObject*>(globalObject), static_cast<WrappedType*>(wrapped))); >+ }), result, globalObject, wrapped); >+} >+ >+} } >+ >+#endif >diff --git a/Source/WebCore/domjit/JSNodeDOMJIT.cpp b/Source/WebCore/domjit/JSNodeDOMJIT.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..9857f8b7f30b6555f1b8b3eba69d2db9fd006fbc >--- /dev/null >+++ b/Source/WebCore/domjit/JSNodeDOMJIT.cpp >@@ -0,0 +1,145 @@ >+/* >+ * 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 "JSNode.h" >+ >+#if ENABLE(JIT) >+ >+#include "DOMJITHelpers.h" >+#include "JSDOMWrapper.h" >+#include "Node.h" >+#include <domjit/DOMJITPatchpoint.h> >+#include <domjit/DOMJITPatchpointParams.h> >+ >+using namespace JSC; >+ >+namespace WebCore { >+ >+enum class IsContainerGuardRequirement { Required, NotRequired }; >+ >+template<typename WrappedNode> >+static Ref<DOMJIT::Patchpoint> createCallDOMForOffsetAccess(ptrdiff_t offset, IsContainerGuardRequirement isContainerGuardRequirement) >+{ >+ Ref<DOMJIT::Patchpoint> patchpoint = DOMJIT::Patchpoint::create(); >+ patchpoint->numGPScratchRegisters = 1; >+ patchpoint->setGenerator([=](CCallHelpers& jit, const DOMJIT::PatchpointParams& params) { >+ JSValueRegs result = params[0].jsValueRegs(); >+ GPRReg globalObject = params[1].gpr(); >+ GPRReg node = params[2].gpr(); >+ GPRReg scratch = params.gpScratch(0); >+ >+ CCallHelpers::JumpList nullCases; >+ jit.loadPtr(CCallHelpers::Address(node, JSNode::offsetOfWrapped()), scratch); >+ >+ if (isContainerGuardRequirement == IsContainerGuardRequirement::Required) >+ nullCases.append(jit.branchTest32(CCallHelpers::Zero, CCallHelpers::Address(scratch, Node::nodeFlagsMemoryOffset()), CCallHelpers::TrustedImm32(Node::flagIsContainer()))); >+ >+ jit.loadPtr(CCallHelpers::Address(scratch, offset), scratch); >+ nullCases.append(jit.branchTestPtr(CCallHelpers::Zero, scratch)); >+ >+ DOMJITHelpers::wrapResult<WrappedNode>(jit, params, scratch, globalObject, result); >+ CCallHelpers::Jump done = jit.jump(); >+ >+ nullCases.link(&jit); >+ jit.moveValue(jsNull(), result); >+ done.link(&jit); >+ return CCallHelpers::JumpList(); >+ }); >+ return patchpoint; >+} >+ >+static Ref<DOMJIT::Patchpoint> checkNode() >+{ >+ Ref<DOMJIT::Patchpoint> patchpoint = DOMJIT::Patchpoint::create(); >+ patchpoint->setGenerator([=](CCallHelpers& jit, const DOMJIT::PatchpointParams& params) { >+ CCallHelpers::JumpList failureCases; >+ failureCases.append(jit.branch8( >+ CCallHelpers::AboveOrEqual, >+ CCallHelpers::Address(params[0].gpr(), JSCell::typeInfoTypeOffset()), >+ CCallHelpers::TrustedImm32(JSC::JSType(JSNodeType)))); >+ return failureCases; >+ }); >+ return patchpoint; >+} >+ >+// Node#firstChild. >+Ref<DOMJIT::Patchpoint> NodeFirstChildDOMJIT::checkDOM() >+{ >+ return checkNode(); >+} >+ >+Ref<DOMJIT::Patchpoint> NodeFirstChildDOMJIT::callDOM() >+{ >+ return createCallDOMForOffsetAccess<Node>(CAST_OFFSET(Node*, ContainerNode*) + ContainerNode::firstChildMemoryOffset(), IsContainerGuardRequirement::Required); >+} >+ >+// Node#lastChild. >+Ref<DOMJIT::Patchpoint> NodeLastChildDOMJIT::checkDOM() >+{ >+ return checkNode(); >+} >+ >+Ref<DOMJIT::Patchpoint> NodeLastChildDOMJIT::callDOM() >+{ >+ return createCallDOMForOffsetAccess<Node>(CAST_OFFSET(Node*, ContainerNode*) + ContainerNode::lastChildMemoryOffset(), IsContainerGuardRequirement::Required); >+} >+ >+// Node#nextSibling. >+Ref<DOMJIT::Patchpoint> NodeNextSiblingDOMJIT::checkDOM() >+{ >+ return checkNode(); >+} >+ >+Ref<DOMJIT::Patchpoint> NodeNextSiblingDOMJIT::callDOM() >+{ >+ return createCallDOMForOffsetAccess<Node>(Node::nextSiblingMemoryOffset(), IsContainerGuardRequirement::NotRequired); >+} >+ >+// Node#previousSibling. >+Ref<DOMJIT::Patchpoint> NodePreviousSiblingDOMJIT::checkDOM() >+{ >+ return checkNode(); >+} >+ >+Ref<DOMJIT::Patchpoint> NodePreviousSiblingDOMJIT::callDOM() >+{ >+ return createCallDOMForOffsetAccess<Node>(Node::previousSiblingMemoryOffset(), IsContainerGuardRequirement::NotRequired); >+} >+ >+// Node#parentNode. >+Ref<DOMJIT::Patchpoint> NodeParentNodeDOMJIT::checkDOM() >+{ >+ return checkNode(); >+} >+ >+Ref<DOMJIT::Patchpoint> NodeParentNodeDOMJIT::callDOM() >+{ >+ return createCallDOMForOffsetAccess<ContainerNode>(Node::parentNodeMemoryOffset(), IsContainerGuardRequirement::NotRequired); >+} >+ >+} >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 163005
:
290894
|
290902
|
290903
|
290907
|
290908
|
290914
|
290915
|
290942
|
290945
|
290954
|
290956
|
290960
|
290985
|
291136