<!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>[169668] trunk/Source</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/169668">169668</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2014-06-06 16:56:50 -0700 (Fri, 06 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Indexed getters should return values directly on the PropertySlot.
&lt;https://webkit.org/b/133586&gt;

Source/JavaScriptCore:
Remove PropertySlot's custom index mode.

Reviewed by Darin Adler.

* runtime/JSObject.h:
(JSC::PropertySlot::getValue):
* runtime/PropertySlot.h:
(JSC::PropertySlot::setCustomIndex): Deleted.

Source/WebCore:
Make indexed getters more efficient by using PropertySlot::setValue()
to pass the value directly back through the slot, instead of giving it
a function pointer that JSC would then immediately call back through
to retrieve the value.

The function pointer approach would make sense if we did inline caching
of indexed getters but since we currently don't, this is pure overhead.

Reviewed by Darin Adler.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate):
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback): Deleted.
(WebCore::cssPropertyGetterCallback): Deleted.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::indexGetter): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateHeader):
(GetIndexedGetterExpression):
(GenerateImplementation):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):
(JSC::RuntimeArray::indexGetter): Deleted.
* bridge/runtime_array.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjecth">trunk/Source/JavaScriptCore/runtime/JSObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePropertySloth">trunk/Source/JavaScriptCore/runtime/PropertySlot.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCSSStyleDeclarationCustomcpp">trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h</a></li>
<li><a href="#trunkSourceWebCorebridgeruntime_arraycpp">trunk/Source/WebCore/bridge/runtime_array.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgeruntime_arrayh">trunk/Source/WebCore/bridge/runtime_array.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-06  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Indexed getters should return values directly on the PropertySlot.
+        &lt;https://webkit.org/b/133586&gt;
+
+        Remove PropertySlot's custom index mode.
+
+        Reviewed by Darin Adler.
+
+        * runtime/JSObject.h:
+        (JSC::PropertySlot::getValue):
+        * runtime/PropertySlot.h:
+        (JSC::PropertySlot::setCustomIndex): Deleted.
+
</ins><span class="cx"> 2014-06-04  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         iOS Debug build fix
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -1560,8 +1560,6 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_propertyType == TypeValue)
</span><span class="cx">         return JSValue::decode(m_data.value);
</span><del>-    if (m_propertyType == TypeCustomIndex)
-        return JSValue::decode(m_data.customIndex.getIndexValue(exec, slotBase(), JSValue::encode(m_thisValue), m_data.customIndex.index));
</del><span class="cx">     if (m_propertyType == TypeGetter)
</span><span class="cx">         return functionGetter(exec);
</span><span class="cx">     return JSValue::decode(m_data.custom.getValue(exec, slotBase(), JSValue::encode(m_thisValue), propertyName));
</span><span class="lines">@@ -1571,8 +1569,6 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_propertyType == TypeValue)
</span><span class="cx">         return JSValue::decode(m_data.value);
</span><del>-    if (m_propertyType == TypeCustomIndex)
-        return JSValue::decode(m_data.customIndex.getIndexValue(exec, slotBase(), JSValue::encode(m_thisValue), m_data.customIndex.index));
</del><span class="cx">     if (m_propertyType == TypeGetter)
</span><span class="cx">         return functionGetter(exec);
</span><span class="cx">     return JSValue::decode(m_data.custom.getValue(exec, slotBase(), JSValue::encode(m_thisValue), Identifier::from(exec, propertyName)));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePropertySloth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PropertySlot.h (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PropertySlot.h        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/JavaScriptCore/runtime/PropertySlot.h        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -52,8 +52,7 @@
</span><span class="cx">         TypeUnset,
</span><span class="cx">         TypeValue,
</span><span class="cx">         TypeGetter,
</span><del>-        TypeCustom,
-        TypeCustomIndex
</del><ins>+        TypeCustom
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     enum CacheabilityType {
</span><span class="lines">@@ -72,7 +71,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     typedef EncodedJSValue (*GetValueFunc)(ExecState*, JSObject* slotBase, EncodedJSValue thisValue, PropertyName);
</span><del>-    typedef EncodedJSValue (*GetIndexValueFunc)(ExecState*, JSObject* slotBase, EncodedJSValue thisValue, unsigned);
</del><span class="cx"> 
</span><span class="cx">     JSValue getValue(ExecState*, PropertyName) const;
</span><span class="cx">     JSValue getValue(ExecState*, unsigned propertyName) const;
</span><span class="lines">@@ -180,19 +178,6 @@
</span><span class="cx">         m_offset = !invalidOffset;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void setCustomIndex(JSObject* slotBase, unsigned attributes, unsigned index, GetIndexValueFunc getIndexValue)
-    {
-        ASSERT(getIndexValue);
-        m_data.customIndex.getIndexValue = getIndexValue;
-        m_data.customIndex.index = index;
-        m_attributes = attributes;
-
-        ASSERT(slotBase);
-        m_slotBase = slotBase;
-        m_propertyType = TypeCustomIndex;
-        m_offset = invalidOffset;
-    }
-
</del><span class="cx">     void setGetterSlot(JSObject* slotBase, unsigned attributes, GetterSetter* getterSetter)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(getterSetter);
</span><span class="lines">@@ -244,10 +229,6 @@
</span><span class="cx">         struct {
</span><span class="cx">             GetValueFunc getValue;
</span><span class="cx">         } custom;
</span><del>-        struct {
-            GetIndexValueFunc getIndexValue;
-            unsigned index;
-        } customIndex;
</del><span class="cx">     } m_data;
</span><span class="cx"> 
</span><span class="cx">     PropertyType m_propertyType;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/ChangeLog        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-06-06  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Indexed getters should return values directly on the PropertySlot.
+        &lt;https://webkit.org/b/133586&gt;
+
+        Make indexed getters more efficient by using PropertySlot::setValue()
+        to pass the value directly back through the slot, instead of giving it
+        a function pointer that JSC would then immediately call back through
+        to retrieve the value.
+
+        The function pointer approach would make sense if we did inline caching
+        of indexed getters but since we currently don't, this is pure overhead.
+
+        Reviewed by Darin Adler.
+
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate):
+        (WebCore::cssPropertyGetterPixelOrPosPrefixCallback): Deleted.
+        (WebCore::cssPropertyGetterCallback): Deleted.
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
+        (WebCore::indexGetter): Deleted.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateGetOwnPropertySlotBody):
+        (GenerateHeader):
+        (GetIndexedGetterExpression):
+        (GenerateImplementation):
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::getOwnPropertySlot):
+        (JSC::RuntimeArray::getOwnPropertySlotByIndex):
+        (JSC::RuntimeArray::indexGetter): Deleted.
+        * bridge/runtime_array.h:
+
</ins><span class="cx"> 2014-06-06  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         GenericCueData elements prematurely removed
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCSSStyleDeclarationCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -297,14 +297,6 @@
</span><span class="cx">     return getPropertyValueFallback(exec, thisObj, propertyID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static EncodedJSValue cssPropertyGetterPixelOrPosPrefixCallback(ExecState* exec, JSObject*, EncodedJSValue thisValue, unsigned propertyID)
-{
-    JSCSSStyleDeclaration* thisObject = jsDynamicCast&lt;JSCSSStyleDeclaration*&gt;(JSValue::decode(thisValue));
-    if (!thisObject)
-        return throwVMTypeError(exec);
-    return JSValue::encode(cssPropertyGetterPixelOrPosPrefix(exec, thisObject, propertyID));
-}
-
</del><span class="cx"> static inline JSValue cssPropertyGetter(ExecState* exec, JSCSSStyleDeclaration* thisObj, unsigned propertyID)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; v = thisObj-&gt;impl().getPropertyCSSValueInternal(static_cast&lt;CSSPropertyID&gt;(propertyID));
</span><span class="lines">@@ -314,24 +306,16 @@
</span><span class="cx">     return getPropertyValueFallback(exec, thisObj, propertyID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static EncodedJSValue cssPropertyGetterCallback(ExecState* exec, JSObject*, EncodedJSValue thisValue, unsigned propertyID)
</del><ins>+bool JSCSSStyleDeclaration::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyIdentifier, PropertySlot&amp; slot)
</ins><span class="cx"> {
</span><del>-    JSCSSStyleDeclaration* thisObject = jsDynamicCast&lt;JSCSSStyleDeclaration*&gt;(JSValue::decode(thisValue));
-    if (!thisObject)
-        return throwVMTypeError(exec);
-    return JSValue::encode(cssPropertyGetter(exec, thisObject, propertyID));
-}
-
-bool JSCSSStyleDeclaration::getOwnPropertySlotDelegate(ExecState*, PropertyName propertyIdentifier, PropertySlot&amp; slot)
-{
</del><span class="cx">     CSSPropertyInfo propertyInfo = cssPropertyIDForJSCSSPropertyName(propertyIdentifier);
</span><span class="cx">     if (!propertyInfo.propertyID)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (propertyInfo.hadPixelOrPosPrefix)
</span><del>-        slot.setCustomIndex(this, DontDelete, static_cast&lt;unsigned&gt;(propertyInfo.propertyID), cssPropertyGetterPixelOrPosPrefixCallback);
</del><ins>+        slot.setValue(this, DontDelete, cssPropertyGetterPixelOrPosPrefix(exec, this, propertyInfo.propertyID));
</ins><span class="cx">     else
</span><del>-        slot.setCustomIndex(this, DontDelete, static_cast&lt;unsigned&gt;(propertyInfo.propertyID), cssPropertyGetterCallback);
</del><ins>+        slot.setValue(this, DontDelete, cssPropertyGetter(exec, this, propertyInfo.propertyID));
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -75,11 +75,6 @@
</span><span class="cx">     return JSValue::encode(toJS(exec, jsCast&lt;JSDOMWindow*&gt;(slotBase)-&gt;impl().frame()-&gt;tree().scopedChild(propertyNameToAtomicString(propertyName))-&gt;document()-&gt;domWindow()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static EncodedJSValue indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)
-{
-    return JSValue::encode(toJS(exec, jsCast&lt;JSDOMWindow*&gt;(slotBase)-&gt;impl().frame()-&gt;tree().scopedChild(index)-&gt;document()-&gt;domWindow()));
-}
-
</del><span class="cx"> static EncodedJSValue namedItemGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
</span><span class="cx"> {
</span><span class="cx">     JSDOMWindowBase* thisObj = jsCast&lt;JSDOMWindow*&gt;(slotBase);
</span><span class="lines">@@ -232,7 +227,8 @@
</span><span class="cx">     unsigned i = propertyName.asIndex();
</span><span class="cx">     if (i &lt; thisObject-&gt;impl().frame()-&gt;tree().scopedChildCount()) {
</span><span class="cx">         ASSERT(i != PropertyName::NotAnIndex);
</span><del>-        slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, i, indexGetter);
</del><ins>+        slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum,
+            toJS(exec, thisObject-&gt;impl().frame()-&gt;tree().scopedChild(i)-&gt;document()-&gt;domWindow()));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -308,7 +304,8 @@
</span><span class="cx">     // allow window[1] or parent[1] etc. (#56983)
</span><span class="cx">     if (index &lt; thisObject-&gt;impl().frame()-&gt;tree().scopedChildCount()) {
</span><span class="cx">         ASSERT(index != PropertyName::NotAnIndex);
</span><del>-        slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, index, indexGetter);
</del><ins>+        slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum,
+            toJS(exec, thisObject-&gt;impl().frame()-&gt;tree().scopedChild(index)-&gt;document()-&gt;domWindow()));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -432,7 +432,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             push(@getOwnPropertySlotImpl, &quot;        unsigned attributes = ${namespaceMaybe}DontDelete | ${namespaceMaybe}ReadOnly;\n&quot;);
</span><span class="cx">         }
</span><del>-        push(@getOwnPropertySlotImpl, &quot;        slot.setCustomIndex(thisObject, attributes, index, indexGetter);\n&quot;);
</del><ins>+        push(@getOwnPropertySlotImpl, &quot;        slot.setValue(thisObject, attributes, &quot; . GetIndexedGetterExpression($indexedGetterFunction) . &quot;);\n&quot;);
</ins><span class="cx">         push(@getOwnPropertySlotImpl, &quot;        return true;\n&quot;);
</span><span class="cx">         push(@getOwnPropertySlotImpl, &quot;    }\n&quot;);
</span><span class="cx">     }
</span><span class="lines">@@ -1126,11 +1126,6 @@
</span><span class="cx">     }
</span><span class="cx">     push(@headerContent, &quot;Base::StructureFlags;\n&quot;);
</span><span class="cx"> 
</span><del>-    # Index getter
-    if ($indexedGetterFunction) {
-        push(@headerContent, &quot;    static JSC::EncodedJSValue indexGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, unsigned);\n&quot;);
-    }
-
</del><span class="cx">     # Index setter
</span><span class="cx">     if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomIndexedSetter&quot;}) {
</span><span class="cx">         push(@headerContent, &quot;    void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n&quot;);
</span><span class="lines">@@ -1721,6 +1716,15 @@
</span><span class="cx">     return &quot;jsCast&lt;JS&quot; . $interface-&gt;name . &quot;*&gt;&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GetIndexedGetterExpression
+{
+    my $indexedGetterFunction = shift;
+    if ($indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;) {
+        return &quot;jsStringOrUndefined(exec, thisObject-&gt;impl().item(index))&quot;;
+    }
+    return &quot;toJS(exec, thisObject-&gt;globalObject(), thisObject-&gt;impl().item(index))&quot;;
+}
+
</ins><span class="cx"> sub GenerateImplementation
</span><span class="cx"> {
</span><span class="cx">     my ($object, $interface) = @_;
</span><span class="lines">@@ -2107,7 +2111,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@implContent, &quot;        unsigned attributes = DontDelete | ReadOnly;\n&quot;);
</span><span class="cx">                 }
</span><del>-                push(@implContent, &quot;        slot.setCustomIndex(thisObject, attributes, index, thisObject-&gt;indexGetter);\n&quot;);
</del><ins>+                push(@implContent, &quot;        slot.setValue(thisObject, attributes, &quot; . GetIndexedGetterExpression($indexedGetterFunction) . &quot;);\n&quot;);
</ins><span class="cx">                 push(@implContent, &quot;        return true;\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    }\n&quot;);
</span><span class="cx">             }
</span><span class="lines">@@ -2889,17 +2893,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($indexedGetterFunction) {
</span><del>-        push(@implContent, &quot;\nEncodedJSValue ${className}::indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)\n&quot;);
-        push(@implContent, &quot;{\n&quot;);
-        push(@implContent, &quot;    ${className}* thisObj = jsCast&lt;$className*&gt;(slotBase);\n&quot;);
-        push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObj, info());\n&quot;);
</del><span class="cx">         if ($indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;) {
</span><span class="cx">             $implIncludes{&quot;URL.h&quot;} = 1;
</span><del>-            push(@implContent, &quot;    return JSValue::encode(jsStringOrUndefined(exec, thisObj-&gt;impl().item(index)));\n&quot;);
-        } else {
-            push(@implContent, &quot;    return JSValue::encode(toJS(exec, thisObj-&gt;globalObject(), thisObj-&gt;impl().item(index)));\n&quot;);
</del><span class="cx">         }
</span><del>-        push(@implContent, &quot;}\n\n&quot;);
</del><span class="cx">         if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq &quot;RadioNodeList&quot;) {
</span><span class="cx">             $implIncludes{&quot;JSNode.h&quot;} = 1;
</span><span class="cx">             $implIncludes{&quot;Node.h&quot;} = 1;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     unsigned index = propertyName.asIndex();
</span><span class="cx">     if (index != PropertyName::NotAnIndex &amp;&amp; index &lt; thisObject-&gt;impl().length()) {
</span><span class="cx">         unsigned attributes = DontDelete | ReadOnly;
</span><del>-        slot.setCustomIndex(thisObject, attributes, index, indexGetter);
</del><ins>+        slot.setValue(thisObject, attributes, toJS(exec, thisObject-&gt;globalObject(), thisObject-&gt;impl().item(index)));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (canGetItemsForName(exec, &amp;thisObject-&gt;impl(), propertyName)) {
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><span class="cx">     if (index &lt; thisObject-&gt;impl().length()) {
</span><span class="cx">         unsigned attributes = DontDelete | ReadOnly;
</span><del>-        slot.setCustomIndex(thisObject, attributes, index, thisObject-&gt;indexGetter);
</del><ins>+        slot.setValue(thisObject, attributes, toJS(exec, thisObject-&gt;globalObject(), thisObject-&gt;impl().item(index)));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     PropertyName propertyName = Identifier::from(exec, index);
</span><span class="lines">@@ -287,14 +287,6 @@
</span><span class="cx">     thisObject-&gt;impl().visitJSEventListeners(visitor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-EncodedJSValue JSTestEventTarget::indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)
-{
-    JSTestEventTarget* thisObj = jsCast&lt;JSTestEventTarget*&gt;(slotBase);
-    ASSERT_GC_OBJECT_INHERITS(thisObj, info());
-    return JSValue::encode(toJS(exec, thisObj-&gt;globalObject(), thisObj-&gt;impl().item(index)));
-}
-
</del><span class="cx"> bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC::Handle&lt;JSC::Unknown&gt; handle, void*, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     JSTestEventTarget* jsTestEventTarget = jsCast&lt;JSTestEventTarget*&gt;(handle.slot()-&gt;asCell());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -79,7 +79,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static const unsigned StructureFlags = JSC::HasImpureGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::MasqueradesAsUndefined | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | JSC::OverridesVisitChildren | Base::StructureFlags;
</span><del>-    static JSC::EncodedJSValue indexGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, unsigned);
</del><span class="cx"> private:
</span><span class="cx">     static bool canGetItemsForName(JSC::ExecState*, TestEventTarget*, JSC::PropertyName);
</span><span class="cx">     static JSC::EncodedJSValue nameGetter(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeruntime_arraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/runtime_array.cpp (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/runtime_array.cpp        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bridge/runtime_array.cpp        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -68,12 +68,6 @@
</span><span class="cx">     return JSValue::encode(jsNumber(thisObject-&gt;getLength()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue RuntimeArray::indexGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, unsigned index)
-{
-    RuntimeArray* thisObj = jsCast&lt;RuntimeArray*&gt;(slotBase);
-    return JSValue::encode(thisObj-&gt;getConcreteArray()-&gt;valueAt(exec, index));
-}
-
</del><span class="cx"> void RuntimeArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</span><span class="cx"> {
</span><span class="cx">     RuntimeArray* thisObject = jsCast&lt;RuntimeArray*&gt;(object);
</span><span class="lines">@@ -98,7 +92,8 @@
</span><span class="cx">     unsigned index = propertyName.asIndex();
</span><span class="cx">     if (index &lt; thisObject-&gt;getLength()) {
</span><span class="cx">         ASSERT(index != PropertyName::NotAnIndex);
</span><del>-        slot.setCustomIndex(thisObject, DontDelete | DontEnum, index, thisObject-&gt;indexGetter);
</del><ins>+        slot.setValue(thisObject, DontDelete | DontEnum,
+            thisObject-&gt;getConcreteArray()-&gt;valueAt(exec, index));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -109,7 +104,8 @@
</span><span class="cx"> {
</span><span class="cx">     RuntimeArray* thisObject = jsCast&lt;RuntimeArray*&gt;(object);
</span><span class="cx">     if (index &lt; thisObject-&gt;getLength()) {
</span><del>-        slot.setCustomIndex(thisObject, DontDelete | DontEnum, index, thisObject-&gt;indexGetter);
</del><ins>+        slot.setValue(thisObject, DontDelete | DontEnum,
+            thisObject-&gt;getConcreteArray()-&gt;valueAt(exec, index));
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeruntime_arrayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/runtime_array.h (169667 => 169668)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/runtime_array.h        2014-06-06 23:32:23 UTC (rev 169667)
+++ trunk/Source/WebCore/bridge/runtime_array.h        2014-06-06 23:56:50 UTC (rev 169668)
</span><span class="lines">@@ -85,7 +85,6 @@
</span><span class="cx"> private:
</span><span class="cx">     RuntimeArray(ExecState*, Structure*);
</span><span class="cx">     static EncodedJSValue lengthGetter(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><del>-    static EncodedJSValue indexGetter(ExecState*, JSObject*, EncodedJSValue, unsigned);
</del><span class="cx"> 
</span><span class="cx">     BindingsArray* m_array;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>