<!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>[207324] 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/207324">207324</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-13 23:19:12 -0700 (Thu, 13 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update serializer and iterator binding generated code
https://bugs.webkit.org/show_bug.cgi?id=163325

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2016-10-13
Reviewed by Darin Adler.

No change of behavior.
Covered by existing tests and rebased binding generated code.

Making use of BindingCaller::callOperation within serializer and iterator operations.
Refactored serializer code to use direct attribute getters.

* bindings/js/JSDOMIterator.h:
(WebCore::iteratorCreate):
(WebCore::iteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateSerializerFunction):
(GenerateImplementationIterableFunctions):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
(WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
(WebCore::jsTestIterablePrototypeFunctionEntries):
(WebCore::jsTestIterablePrototypeFunctionKeysCaller):
(WebCore::jsTestIterablePrototypeFunctionKeys):
(WebCore::jsTestIterablePrototypeFunctionValuesCaller):
(WebCore::jsTestIterablePrototypeFunctionValues):
(WebCore::jsTestIterablePrototypeFunctionForEachCaller):
(WebCore::jsTestIterablePrototypeFunctionForEach):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
(WebCore::jsTestNodePrototypeFunctionSymbolIterator):
(WebCore::jsTestNodePrototypeFunctionEntriesCaller):
(WebCore::jsTestNodePrototypeFunctionEntries):
(WebCore::jsTestNodePrototypeFunctionKeysCaller):
(WebCore::jsTestNodePrototypeFunctionKeys):
(WebCore::jsTestNodePrototypeFunctionValuesCaller):
(WebCore::jsTestNodePrototypeFunctionValues):
(WebCore::jsTestNodePrototypeFunctionForEachCaller):
(WebCore::jsTestNodePrototypeFunctionForEach):
(WebCore::jsTestNodePrototypeFunctionToJSON):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionToJSON):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMIteratorh">trunk/Source/WebCore/bindings/js/JSDOMIterator.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestIterablecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/ChangeLog        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-10-13  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Update serializer and iterator binding generated code
+        https://bugs.webkit.org/show_bug.cgi?id=163325
+
+        Reviewed by Darin Adler.
+
+        No change of behavior.
+        Covered by existing tests and rebased binding generated code.
+
+        Making use of BindingCaller::callOperation within serializer and iterator operations.
+        Refactored serializer code to use direct attribute getters.
+
+        * bindings/js/JSDOMIterator.h:
+        (WebCore::iteratorCreate):
+        (WebCore::iteratorForEach):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateSerializerFunction):
+        (GenerateImplementationIterableFunctions):
+        * bindings/scripts/test/JS/JSTestIterable.cpp:
+        (WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
+        (WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
+        (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
+        (WebCore::jsTestIterablePrototypeFunctionEntries):
+        (WebCore::jsTestIterablePrototypeFunctionKeysCaller):
+        (WebCore::jsTestIterablePrototypeFunctionKeys):
+        (WebCore::jsTestIterablePrototypeFunctionValuesCaller):
+        (WebCore::jsTestIterablePrototypeFunctionValues):
+        (WebCore::jsTestIterablePrototypeFunctionForEachCaller):
+        (WebCore::jsTestIterablePrototypeFunctionForEach):
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
+        (WebCore::jsTestNodePrototypeFunctionSymbolIterator):
+        (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
+        (WebCore::jsTestNodePrototypeFunctionEntries):
+        (WebCore::jsTestNodePrototypeFunctionKeysCaller):
+        (WebCore::jsTestNodePrototypeFunctionKeys):
+        (WebCore::jsTestNodePrototypeFunctionValuesCaller):
+        (WebCore::jsTestNodePrototypeFunctionValues):
+        (WebCore::jsTestNodePrototypeFunctionForEachCaller):
+        (WebCore::jsTestNodePrototypeFunctionForEach):
+        (WebCore::jsTestNodePrototypeFunctionToJSON):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionToJSON):
+
</ins><span class="cx"> 2016-10-13  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix API test after r207318.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMIterator.h (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -124,21 +124,16 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue iteratorCreate(JSC::ExecState&amp;, IterationKind, const char*);
</del><ins>+JSC::JSValue iteratorCreate(JSWrapper&amp;, IterationKind);
</ins><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue iteratorForEach(JSC::ExecState&amp;, const char*);
</del><ins>+JSC::JSValue iteratorForEach(JSC::ExecState&amp;, JSWrapper&amp;, JSC::ThrowScope&amp;);
</ins><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue iteratorCreate(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
</del><ins>+JSC::JSValue iteratorCreate(JSWrapper&amp; thisObject, IterationKind kind)
</ins><span class="cx"> {
</span><del>-    JSC::VM&amp; vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
-    if (UNLIKELY(!wrapper))
-        return throwThisTypeError(state, scope, JSWrapper::info()-&gt;className, propertyName);
-    JSDOMGlobalObject&amp; globalObject = *wrapper-&gt;globalObject();
-    return JSC::JSValue::encode(JSDOMIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSDOMIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), *wrapper, kind));
</del><ins>+    ASSERT(thisObject.globalObject());
+    JSDOMGlobalObject&amp; globalObject = *thisObject.globalObject();
+    return JSDOMIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSDOMIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), thisObject, kind);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><span class="lines">@@ -182,15 +177,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue iteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
</del><ins>+JSC::JSValue iteratorForEach(JSC::ExecState&amp; state, JSWrapper&amp; thisObject, JSC::ThrowScope&amp; scope)
</ins><span class="cx"> {
</span><del>-    JSC::VM&amp; vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
-    if (UNLIKELY(!wrapper))
-        return throwThisTypeError(state, scope, JSWrapper::info()-&gt;className, propertyName);
-
</del><span class="cx">     JSC::JSValue callback = state.argument(0);
</span><span class="cx">     JSC::JSValue thisValue = state.argument(1);
</span><span class="cx"> 
</span><span class="lines">@@ -197,18 +185,18 @@
</span><span class="cx">     JSC::CallData callData;
</span><span class="cx">     JSC::CallType callType = JSC::getCallData(callback, callData);
</span><span class="cx">     if (callType == JSC::CallType::None)
</span><del>-        return throwVMTypeError(&amp;state, scope);
</del><ins>+        return throwTypeError(&amp;state, scope, ASCIILiteral(&quot;Cannot call callback&quot;));
</ins><span class="cx"> 
</span><del>-    auto iterator = wrapper-&gt;wrapped().createIterator();
</del><ins>+    auto iterator = thisObject.wrapped().createIterator();
</ins><span class="cx">     while (auto value = iterator.next()) {
</span><span class="cx">         JSC::MarkedArgumentBuffer arguments;
</span><del>-        appendForEachArguments(state, wrapper-&gt;globalObject(), arguments, value);
-        arguments.append(wrapper);
</del><ins>+        appendForEachArguments(state, thisObject.globalObject(), arguments, value);
+        arguments.append(&amp;thisObject);
</ins><span class="cx">         JSC::call(&amp;state, callback, callType, callData, thisValue, arguments);
</span><span class="cx">         if (UNLIKELY(scope.exception()))
</span><span class="cx">             break;
</span><span class="cx">     }
</span><del>-    return JSC::JSValue::encode(JSC::jsUndefined());
</del><ins>+    return JSC::jsUndefined();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -3976,28 +3976,29 @@
</span><span class="cx">     my $serializerNativeFunctionName = $codeGenerator-&gt;WK_lcfirst($className) . &quot;PrototypeFunction&quot; . $codeGenerator-&gt;WK_ucfirst($serializerFunctionName);
</span><span class="cx"> 
</span><span class="cx">     AddToImplIncludes(&quot;ObjectConstructor.h&quot;);
</span><del>-    push(@implContent, &quot;EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n&quot;);
</del><ins>+    push(@implContent, &quot;static inline EncodedJSValue ${serializerNativeFunctionName}Caller(ExecState* state, JS$interfaceName* thisObject, JSC::ThrowScope&amp; throwScope)\n&quot;);
</ins><span class="cx">     push(@implContent, &quot;{\n&quot;);
</span><del>-    push(@implContent, &quot;    ASSERT(state);\n&quot;);
-    push(@implContent, &quot;    auto thisValue = state-&gt;thisValue();\n&quot;);
-    push(@implContent, &quot;    auto castedThis = jsDynamicCast&lt;JS$interfaceName*&gt;(thisValue);\n&quot;);
-    push(@implContent, &quot;    VM&amp; vm = state-&gt;vm();\n&quot;);
-    push(@implContent, &quot;    auto throwScope = DECLARE_THROW_SCOPE(vm);\n&quot;);
-    push(@implContent, &quot;    if (UNLIKELY(!castedThis))\n&quot;);
-    push(@implContent, &quot;        return throwThisTypeError(*state, throwScope, \&quot;$interfaceName\&quot;, \&quot;$serializerFunctionName\&quot;);\n&quot;);
-    push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(castedThis, ${className}::info());\n\n&quot;) unless $interfaceName eq &quot;EventTarget&quot;;
</del><ins>+    push(@implContent, &quot;    auto&amp; vm = state-&gt;vm();\n&quot;);
</ins><span class="cx">     push(@implContent, &quot;    auto* result = constructEmptyObject(state);\n&quot;);
</span><ins>+    push(@implContent, &quot;\n&quot;);
</ins><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">         my $name = $attribute-&gt;signature-&gt;name;
</span><span class="cx">         if (grep $_ eq $name, @{$interface-&gt;serializable-&gt;attributes}) {
</span><span class="cx">             my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><del>-            push(@implContent, &quot;    auto ${name}Value = ${getFunctionName}(state, JSValue::encode(thisValue), Identifier());\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto ${name}Value = ${getFunctionName}Getter(*state, *thisObject, throwScope);\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;    ASSERT(!throwScope.exception());\n&quot;);
</span><del>-            push(@implContent, &quot;    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, \&quot;${name}\&quot;), JSValue::decode(${name}Value));\n&quot;);
</del><ins>+            push(@implContent, &quot;    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, \&quot;${name}\&quot;), ${name}Value);\n&quot;);
+            push(@implContent, &quot;\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     push(@implContent, &quot;    return JSValue::encode(result);\n&quot;);
</span><del>-    push(@implContent, &quot;}\n\n&quot;);
</del><ins>+    push(@implContent, &quot;}\n&quot;);
+    push(@implContent, &quot;\n&quot;);
+    push(@implContent, &quot;EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n&quot;);
+    push(@implContent, &quot;{\n&quot;);
+    push(@implContent, &quot;    return BindingCaller&lt;JS$interfaceName&gt;::callOperation&lt;${serializerNativeFunctionName}Caller&gt;(state, \&quot;$serializerFunctionName\&quot;);\n&quot;);
+    push(@implContent, &quot;}\n&quot;);
+    push(@implContent, &quot;\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateCallWithUsingReferences
</span><span class="lines">@@ -4801,27 +4802,36 @@
</span><span class="cx">         my $propertyName = $function-&gt;signature-&gt;name;
</span><span class="cx">         my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx"> 
</span><del>-        if (not $propertyName eq &quot;forEach&quot;) {
</del><ins>+        if ($propertyName eq &quot;forEach&quot;) {
+            push(@implContent,  &lt;&lt;END);
+static inline EncodedJSValue ${functionName}Caller(ExecState* state, JS$interfaceName* thisObject, JSC::ThrowScope&amp; throwScope)
+{
+    return JSValue::encode(iteratorForEach&lt;${className}&gt;(*state, *thisObject, throwScope));
+}
+
+END
+        } else {
</ins><span class="cx">             my $iterationKind = &quot;KeyValue&quot;;
</span><span class="cx">             $iterationKind = &quot;Key&quot; if $propertyName eq &quot;keys&quot;;
</span><span class="cx">             $iterationKind = &quot;Value&quot; if $propertyName eq &quot;values&quot;;
</span><span class="cx">             $iterationKind = &quot;Value&quot; if $propertyName eq &quot;[Symbol.Iterator]&quot; and not $interface-&gt;iterable-&gt;isKeyValue;
</span><ins>+
</ins><span class="cx">             push(@implContent,  &lt;&lt;END);
</span><del>-JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
</del><ins>+static inline EncodedJSValue ${functionName}Caller(ExecState*, JS$interfaceName* thisObject, JSC::ThrowScope&amp;)
</ins><span class="cx"> {
</span><del>-    return iteratorCreate&lt;${className}&gt;(*state, IterationKind::${iterationKind}, &quot;${propertyName}&quot;);
</del><ins>+    return JSValue::encode(iteratorCreate&lt;${className}&gt;(*thisObject, IterationKind::${iterationKind}));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><del>-        } else {
-            push(@implContent,  &lt;&lt;END);
</del><ins>+        }
+
+        push(@implContent,  &lt;&lt;END);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorForEach&lt;${className}&gt;(*state, &quot;${propertyName}&quot;);
</del><ins>+    return BindingCaller&lt;$className&gt;::callOperation&lt;${functionName}Caller&gt;(state, &quot;${propertyName}&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestIterablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -172,29 +172,54 @@
</span><span class="cx"> template&lt;&gt;
</span><span class="cx"> const JSC::ClassInfo TestIterableIteratorPrototype::s_info = { &quot;TestIterable Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestIterableIteratorPrototype) };
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionSymbolIteratorCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestIterable&gt;(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionSymbolIterator(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestIterable&gt;(*state, IterationKind::Value, &quot;[Symbol.Iterator]&quot;);
</del><ins>+    return BindingCaller&lt;JSTestIterable&gt;::callOperation&lt;jsTestIterablePrototypeFunctionSymbolIteratorCaller&gt;(state, &quot;[Symbol.Iterator]&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionEntriesCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestIterable&gt;(*thisObject, IterationKind::KeyValue));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionEntries(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestIterable&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
</del><ins>+    return BindingCaller&lt;JSTestIterable&gt;::callOperation&lt;jsTestIterablePrototypeFunctionEntriesCaller&gt;(state, &quot;entries&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionKeysCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestIterable&gt;(*thisObject, IterationKind::Key));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionKeys(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestIterable&gt;(*state, IterationKind::Key, &quot;keys&quot;);
</del><ins>+    return BindingCaller&lt;JSTestIterable&gt;::callOperation&lt;jsTestIterablePrototypeFunctionKeysCaller&gt;(state, &quot;keys&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionValuesCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestIterable&gt;(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionValues(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestIterable&gt;(*state, IterationKind::Value, &quot;values&quot;);
</del><ins>+    return BindingCaller&lt;JSTestIterable&gt;::callOperation&lt;jsTestIterablePrototypeFunctionValuesCaller&gt;(state, &quot;values&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionForEachCaller(ExecState* state, JSTestIterable* thisObject, JSC::ThrowScope&amp; throwScope)
+{
+    return JSValue::encode(iteratorForEach&lt;JSTestIterable&gt;(*state, *thisObject, throwScope));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionForEach(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorForEach&lt;JSTestIterable&gt;(*state, &quot;forEach&quot;);
</del><ins>+    return BindingCaller&lt;JSTestIterable&gt;::callOperation&lt;jsTestIterablePrototypeFunctionForEachCaller&gt;(state, &quot;forEach&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestIterableOwner::isReachableFromOpaqueRoots(JSC::Handle&lt;JSC::Unknown&gt; handle, void*, SlotVisitor&amp; visitor)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -274,49 +274,73 @@
</span><span class="cx"> template&lt;&gt;
</span><span class="cx"> const JSC::ClassInfo TestNodeIteratorPrototype::s_info = { &quot;TestNode Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestNodeIteratorPrototype) };
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionSymbolIteratorCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestNode&gt;(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionSymbolIterator(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Value, &quot;[Symbol.Iterator]&quot;);
</del><ins>+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionSymbolIteratorCaller&gt;(state, &quot;[Symbol.Iterator]&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionEntriesCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestNode&gt;(*thisObject, IterationKind::KeyValue));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionEntries(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
</del><ins>+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionEntriesCaller&gt;(state, &quot;entries&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionKeysCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestNode&gt;(*thisObject, IterationKind::Key));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionKeys(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Key, &quot;keys&quot;);
</del><ins>+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionKeysCaller&gt;(state, &quot;keys&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionValuesCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&amp;)
+{
+    return JSValue::encode(iteratorCreate&lt;JSTestNode&gt;(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionValues(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Value, &quot;values&quot;);
</del><ins>+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionValuesCaller&gt;(state, &quot;values&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionForEachCaller(ExecState* state, JSTestNode* thisObject, JSC::ThrowScope&amp; throwScope)
+{
+    return JSValue::encode(iteratorForEach&lt;JSTestNode&gt;(*state, *thisObject, throwScope));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionForEach(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return iteratorForEach&lt;JSTestNode&gt;(*state, &quot;forEach&quot;);
</del><ins>+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionForEachCaller&gt;(state, &quot;forEach&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionToJSON(ExecState* state)
</del><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionToJSONCaller(ExecState* state, JSTestNode* thisObject, JSC::ThrowScope&amp; throwScope)
</ins><span class="cx"> {
</span><del>-    ASSERT(state);
-    auto thisValue = state-&gt;thisValue();
-    auto castedThis = jsDynamicCast&lt;JSTestNode*&gt;(thisValue);
-    VM&amp; vm = state-&gt;vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, throwScope, &quot;TestNode&quot;, &quot;toJSON&quot;);
-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestNode::info());
</del><ins>+    auto&amp; vm = state-&gt;vm();
+    auto* result = constructEmptyObject(state);
</ins><span class="cx"> 
</span><del>-    auto* result = constructEmptyObject(state);
-    auto nameValue = jsTestNodeName(state, JSValue::encode(thisValue), Identifier());
</del><ins>+    auto nameValue = jsTestNodeNameGetter(*state, *thisObject, throwScope);
</ins><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;name&quot;), JSValue::decode(nameValue));
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;name&quot;), nameValue);
+
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionToJSON(ExecState* state)
+{
+    return BindingCaller&lt;JSTestNode&gt;::callOperation&lt;jsTestNodePrototypeFunctionToJSONCaller&gt;(state, &quot;toJSON&quot;);
+}
+
</ins><span class="cx"> void JSTestNode::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestNode*&gt;(cell);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207323 => 207324)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-14 05:39:07 UTC (rev 207323)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-14 06:19:12 UTC (rev 207324)
</span><span class="lines">@@ -7735,33 +7735,35 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToJSON(ExecState* state)
</del><ins>+static inline EncodedJSValue jsTestObjPrototypeFunctionToJSONCaller(ExecState* state, JSTestObj* thisObject, JSC::ThrowScope&amp; throwScope)
</ins><span class="cx"> {
</span><del>-    ASSERT(state);
-    auto thisValue = state-&gt;thisValue();
-    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
-    VM&amp; vm = state-&gt;vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, throwScope, &quot;TestObj&quot;, &quot;toJSON&quot;);
-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</del><ins>+    auto&amp; vm = state-&gt;vm();
+    auto* result = constructEmptyObject(state);
</ins><span class="cx"> 
</span><del>-    auto* result = constructEmptyObject(state);
-    auto readOnlyStringAttrValue = jsTestObjReadOnlyStringAttr(state, JSValue::encode(thisValue), Identifier());
</del><ins>+    auto readOnlyStringAttrValue = jsTestObjReadOnlyStringAttrGetter(*state, *thisObject, throwScope);
</ins><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;readOnlyStringAttr&quot;), JSValue::decode(readOnlyStringAttrValue));
-    auto enumAttrValue = jsTestObjEnumAttr(state, JSValue::encode(thisValue), Identifier());
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;readOnlyStringAttr&quot;), readOnlyStringAttrValue);
+
+    auto enumAttrValue = jsTestObjEnumAttrGetter(*state, *thisObject, throwScope);
</ins><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;enumAttr&quot;), JSValue::decode(enumAttrValue));
-    auto longAttrValue = jsTestObjLongAttr(state, JSValue::encode(thisValue), Identifier());
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;enumAttr&quot;), enumAttrValue);
+
+    auto longAttrValue = jsTestObjLongAttrGetter(*state, *thisObject, throwScope);
</ins><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;longAttr&quot;), JSValue::decode(longAttrValue));
-    auto createValue = jsTestObjCreate(state, JSValue::encode(thisValue), Identifier());
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;longAttr&quot;), longAttrValue);
+
+    auto createValue = jsTestObjCreateGetter(*state, *thisObject, throwScope);
</ins><span class="cx">     ASSERT(!throwScope.exception());
</span><del>-    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;create&quot;), JSValue::decode(createValue));
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;create&quot;), createValue);
+
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToJSON(ExecState* state)
+{
+    return BindingCaller&lt;JSTestObj&gt;::callOperation&lt;jsTestObjPrototypeFunctionToJSONCaller&gt;(state, &quot;toJSON&quot;);
+}
+
</ins><span class="cx"> void JSTestObj::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestObj*&gt;(cell);
</span></span></pre>
</div>
</div>

</body>
</html>