<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166520] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166520">166520</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2014-03-31 13:23:21 -0700 (Mon, 31 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Always inline toJS() for NodeList.
&lt;https://webkit.org/b/130974&gt;

This is a pretty cheesy optimization, but it's a 3% progression on
Dromaeo/dom-query.html on my MBP.

Reviewed by Benjamin Poulain.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSNodeListCustom.h: Added.
(WebCore::toJS):
* dom/NodeList.idl:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeListCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeListidl">trunk/Source/WebCore/dom/NodeList.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeListCustomh">trunk/Source/WebCore/bindings/js/JSNodeListCustom.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166519 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-31 20:03:26 UTC (rev 166519)
+++ trunk/Source/WebCore/ChangeLog        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-03-31  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Always inline toJS() for NodeList.
+        &lt;https://webkit.org/b/130974&gt;
+
+        This is a pretty cheesy optimization, but it's a 3% progression on
+        Dromaeo/dom-query.html on my MBP.
+
+        Reviewed by Benjamin Poulain.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSNodeListCustom.h: Added.
+        (WebCore::toJS):
+        * dom/NodeList.idl:
+
</ins><span class="cx"> 2014-03-31  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the 32bits debug builds
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (166519 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-31 20:03:26 UTC (rev 166519)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -306,6 +306,7 @@
</span><span class="cx"> __ZN7WebCore13StyledElement22setInlineStylePropertyENS_13CSSPropertyIDEdNS_17CSSPrimitiveValue9UnitTypesEb
</span><span class="cx"> __ZN7WebCore13cookiesForDOMERKNS_21NetworkStorageSessionERKNS_3URLES5_
</span><span class="cx"> __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
</span><ins>+__ZN7WebCore13createWrapperERNS_17JSDOMGlobalObjectERNS_8NodeListE
</ins><span class="cx"> __ZN7WebCore13directoryNameERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore13listDirectoryERKN3WTF6StringES3_
</span><span class="cx"> __ZN7WebCore13pointerCursorEv
</span><span class="lines">@@ -1081,7 +1082,6 @@
</span><span class="cx"> __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_14ClientRectListE
</span><span class="cx"> __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
</span><span class="cx"> __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
</span><del>-__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE
</del><span class="cx"> __ZN7WebCore50restrictScaleFactorToInitialScaleIfNotUserScalableERNS_18ViewportAttributesE
</span><span class="cx"> __ZN7WebCore5Color11transparentE
</span><span class="cx"> __ZN7WebCore5Color5whiteE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (166519 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-31 20:03:26 UTC (rev 166519)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -4224,6 +4224,7 @@
</span><span class="cx">                 ABDDFE790A5C6E7000A3E11D /* RenderMenuList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABDDFE730A5C6E6F00A3E11D /* RenderMenuList.cpp */; };
</span><span class="cx">                 ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */; };
</span><span class="cx">                 AD03AAFA1468455300A39B5B /* CSSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD03AAF81468453900A39B5B /* CSSValue.cpp */; };
</span><ins>+                AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 AD4495F3141FC08900541EDF /* EventListenerMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4495F1141FC08900541EDF /* EventListenerMap.cpp */; };
</span><span class="cx">                 AD4495F4141FC08900541EDF /* EventListenerMap.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4495F2141FC08900541EDF /* EventListenerMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */; };
</span><span class="lines">@@ -11327,6 +11328,7 @@
</span><span class="cx">                 ABDDFE730A5C6E6F00A3E11D /* RenderMenuList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMenuList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderMenuList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD03AAF81468453900A39B5B /* CSSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeListCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 AD4495F1141FC08900541EDF /* EventListenerMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventListenerMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD4495F2141FC08900541EDF /* EventListenerMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListenerMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentSharedObjectPool.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20563,6 +20565,7 @@
</span><span class="cx">                                 BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */,
</span><span class="cx">                                 1A750DD30A90E729000FF215 /* JSNodeIteratorCustom.cpp */,
</span><span class="cx">                                 BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */,
</span><ins>+                                AD20B18C18E9D216005A8083 /* JSNodeListCustom.h */,
</ins><span class="cx">                                 FDBD1DFB167FE27D0051A11E /* JSOscillatorNodeCustom.cpp */,
</span><span class="cx">                                 FD8AA63D169514A700D2EA68 /* JSPannerNodeCustom.cpp */,
</span><span class="cx">                                 A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
</span><span class="lines">@@ -24035,6 +24038,7 @@
</span><span class="cx">                                 A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
</span><span class="cx">                                 E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
</span><span class="cx">                                 977E2DCE12F0E28300C13379 /* HTMLSourceTracker.h in Headers */,
</span><ins>+                                AD20B18D18E9D237005A8083 /* JSNodeListCustom.h in Headers */,
</ins><span class="cx">                                 978AD67514130A8D00C7CAE3 /* HTMLSpanElement.h in Headers */,
</span><span class="cx">                                 A871DC230A15205700B12A68 /* HTMLStyleElement.h in Headers */,
</span><span class="cx">                                 D3D4E973130C7CFE007BA540 /* HTMLSummaryElement.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeListCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp (166519 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2014-03-31 20:03:26 UTC (rev 166519)
+++ trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -60,4 +60,10 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSC::JSValue createWrapper(JSDOMGlobalObject&amp; globalObject, NodeList&amp; nodeList)
+{
+    globalObject.vm().heap.reportExtraMemoryCost(nodeList.memoryCost());
+    return createNewWrapper&lt;JSNodeList&gt;(&amp;globalObject, &amp;nodeList);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeListCustomhfromrev166519trunkSourceWebCorebindingsjsJSNodeListCustomcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSNodeListCustom.h (from rev 166519, trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp) (0 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeListCustom.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSNodeListCustom.h        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef JSNodeListCustom_h
+#define JSNodeListCustom_h
+
+#include &quot;JSDOMBinding.h&quot;
+#include &quot;JSNodeList.h&quot;
+
+namespace WebCore {
+
+JSC::JSValue createWrapper(JSDOMGlobalObject&amp;, NodeList&amp;);
+
+ALWAYS_INLINE JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, NodeList* nodeList)
+{
+    if (!nodeList)
+        return JSC::jsNull();
+    if (JSC::JSValue existingWrapper = getExistingWrapper&lt;JSNodeList&gt;(globalObject, nodeList))
+        return existingWrapper;
+    return createWrapper(*globalObject, *nodeList);
+}
+
+} // namespace WebCore
+
+#endif // JSNodeListCustom_h
</ins></span></pre></div>
<a id="trunkSourceWebCoredomNodeListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeList.idl (166519 => 166520)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeList.idl        2014-03-31 20:03:26 UTC (rev 166519)
+++ trunk/Source/WebCore/dom/NodeList.idl        2014-03-31 20:23:21 UTC (rev 166520)
</span><span class="lines">@@ -20,7 +20,9 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     CustomIsReachable,
</span><ins>+    CustomToJSObject,
</ins><span class="cx">     JSCustomGetOwnPropertySlotAndDescriptor,
</span><ins>+    JSCustomHeader,
</ins><span class="cx">     SkipVTableValidation,
</span><span class="cx">     ReportExtraMemoryCost,
</span><span class="cx"> ] interface NodeList {
</span></span></pre>
</div>
</div>

</body>
</html>