Changeset 166520 in webkit
- Timestamp:
- Mar 31, 2014 1:23:21 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166519 r166520 1 2014-03-31 Andreas Kling <akling@apple.com> 2 3 Always inline toJS() for NodeList. 4 <https://webkit.org/b/130974> 5 6 This is a pretty cheesy optimization, but it's a 3% progression on 7 Dromaeo/dom-query.html on my MBP. 8 9 Reviewed by Benjamin Poulain. 10 11 * WebCore.exp.in: 12 * WebCore.xcodeproj/project.pbxproj: 13 * bindings/js/JSNodeListCustom.h: Added. 14 (WebCore::toJS): 15 * dom/NodeList.idl: 16 1 17 2014-03-31 Benjamin Poulain <bpoulain@apple.com> 2 18 -
trunk/Source/WebCore/WebCore.exp.in
r166517 r166520 307 307 __ZN7WebCore13cookiesForDOMERKNS_21NetworkStorageSessionERKNS_3URLES5_ 308 308 __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE 309 __ZN7WebCore13createWrapperERNS_17JSDOMGlobalObjectERNS_8NodeListE 309 310 __ZN7WebCore13directoryNameERKN3WTF6StringE 310 311 __ZN7WebCore13listDirectoryERKN3WTF6StringES3_ … … 1082 1083 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE 1083 1084 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE 1084 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE1085 1085 __ZN7WebCore50restrictScaleFactorToInitialScaleIfNotUserScalableERNS_18ViewportAttributesE 1086 1086 __ZN7WebCore5Color11transparentE -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r166447 r166520 4225 4225 ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */; }; 4226 4226 AD03AAFA1468455300A39B5B /* CSSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD03AAF81468453900A39B5B /* CSSValue.cpp */; }; 4227 AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4227 4228 AD4495F3141FC08900541EDF /* EventListenerMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4495F1141FC08900541EDF /* EventListenerMap.cpp */; }; 4228 4229 AD4495F4141FC08900541EDF /* EventListenerMap.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4495F2141FC08900541EDF /* EventListenerMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 11328 11329 ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderMenuList.h; sourceTree = "<group>"; }; 11329 11330 AD03AAF81468453900A39B5B /* CSSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValue.cpp; sourceTree = "<group>"; }; 11331 AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeListCustom.h; sourceTree = "<group>"; }; 11330 11332 AD4495F1141FC08900541EDF /* EventListenerMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventListenerMap.cpp; sourceTree = "<group>"; }; 11331 11333 AD4495F2141FC08900541EDF /* EventListenerMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListenerMap.h; sourceTree = "<group>"; }; … … 20564 20566 1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */, 20565 20567 BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */, 20568 AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */, 20566 20569 FDBD1DFB167FE27D0051A11E /* JSOscillatorNodeCustom.cpp */, 20567 20570 FD8AA63D169514A700D2EA68 /* JSPannerNodeCustom.cpp */, … … 24036 24039 E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */, 24037 24040 977E2DCE12F0E28300C13379 /* HTMLSourceTracker.h in Headers */, 24041 AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */, 24038 24042 978AD67514130A8D00C7CAE3 /* HTMLSpanElement.h in Headers */, 24039 24043 A871DC230A15205700B12A68 /* HTMLStyleElement.h in Headers */, -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r165757 r166520 61 61 } 62 62 63 JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList) 64 { 65 globalObject.vm().heap.reportExtraMemoryCost(nodeList.memoryCost()); 66 return createNewWrapper<JSNodeList>(&globalObject, &nodeList); 67 } 68 63 69 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSNodeListCustom.h
r166519 r166520 1 1 /* 2 * Copyright (C) 20 07, 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #include "config.h" 26 #ifndef JSNodeListCustom_h 27 #define JSNodeListCustom_h 28 29 #include "JSDOMBinding.h" 27 30 #include "JSNodeList.h" 28 29 #include "ChildNodeList.h"30 #include "JSNode.h"31 #include "LiveNodeList.h"32 #include "Node.h"33 #include "NodeList.h"34 #include <wtf/text/AtomicString.h>35 36 using namespace JSC;37 31 38 32 namespace WebCore { 39 33 40 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) 34 JSC::JSValue createWrapper(JSDOMGlobalObject&, NodeList&); 35 36 ALWAYS_INLINE JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, NodeList* nodeList) 41 37 { 42 JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.slot()->asCell()); 43 if (!jsNodeList->hasCustomProperties()) 44 return false; 45 if (jsNodeList->impl().isLiveNodeList()) 46 return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList->impl()).ownerNode())); 47 if (jsNodeList->impl().isChildNodeList()) 48 return visitor.containsOpaqueRoot(root(static_cast<ChildNodeList&>(jsNodeList->impl()).ownerNode())); 49 if (jsNodeList->impl().isEmptyNodeList()) 50 return visitor.containsOpaqueRoot(root(static_cast<EmptyNodeList&>(jsNodeList->impl()).ownerNode())); 51 return false; 52 } 53 54 bool JSNodeList::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyName, PropertySlot& slot) 55 { 56 if (Node* item = impl().namedItem(propertyNameToAtomicString(propertyName))) { 57 slot.setValue(this, ReadOnly | DontDelete | DontEnum, toJS(exec, globalObject(), item)); 58 return true; 59 } 60 return false; 38 if (!nodeList) 39 return JSC::jsNull(); 40 if (JSC::JSValue existingWrapper = getExistingWrapper<JSNodeList>(globalObject, nodeList)) 41 return existingWrapper; 42 return createWrapper(*globalObject, *nodeList); 61 43 } 62 44 63 45 } // namespace WebCore 46 47 #endif // JSNodeListCustom_h -
trunk/Source/WebCore/dom/NodeList.idl
r164853 r166520 21 21 [ 22 22 CustomIsReachable, 23 CustomToJSObject, 23 24 JSCustomGetOwnPropertySlotAndDescriptor, 25 JSCustomHeader, 24 26 SkipVTableValidation, 25 27 ReportExtraMemoryCost,
Note: See TracChangeset
for help on using the changeset viewer.