<!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 <youenn@apple.com> 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 <youenn@apple.com>
+
+ 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 <achristensen@webkit.org>
</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<typename JSWrapper>
</span><del>-JSC::EncodedJSValue iteratorCreate(JSC::ExecState&, IterationKind, const char*);
</del><ins>+JSC::JSValue iteratorCreate(JSWrapper&, IterationKind);
</ins><span class="cx"> template<typename JSWrapper>
</span><del>-JSC::EncodedJSValue iteratorForEach(JSC::ExecState&, const char*);
</del><ins>+JSC::JSValue iteratorForEach(JSC::ExecState&, JSWrapper&, JSC::ThrowScope&);
</ins><span class="cx">
</span><span class="cx"> template<typename JSWrapper>
</span><del>-JSC::EncodedJSValue iteratorCreate(JSC::ExecState& state, IterationKind kind, const char* propertyName)
</del><ins>+JSC::JSValue iteratorCreate(JSWrapper& thisObject, IterationKind kind)
</ins><span class="cx"> {
</span><del>- JSC::VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- auto wrapper = JSC::jsDynamicCast<JSWrapper*>(state.thisValue());
- if (UNLIKELY(!wrapper))
- return throwThisTypeError(state, scope, JSWrapper::info()->className, propertyName);
- JSDOMGlobalObject& globalObject = *wrapper->globalObject();
- return JSC::JSValue::encode(JSDOMIterator<JSWrapper>::create(globalObject.vm(), getDOMStructure<JSDOMIterator<JSWrapper>>(globalObject.vm(), globalObject), *wrapper, kind));
</del><ins>+ ASSERT(thisObject.globalObject());
+ JSDOMGlobalObject& globalObject = *thisObject.globalObject();
+ return JSDOMIterator<JSWrapper>::create(globalObject.vm(), getDOMStructure<JSDOMIterator<JSWrapper>>(globalObject.vm(), globalObject), thisObject, kind);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename JSWrapper>
</span><span class="lines">@@ -182,15 +177,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename JSWrapper>
</span><del>-JSC::EncodedJSValue iteratorForEach(JSC::ExecState& state, const char* propertyName)
</del><ins>+JSC::JSValue iteratorForEach(JSC::ExecState& state, JSWrapper& thisObject, JSC::ThrowScope& scope)
</ins><span class="cx"> {
</span><del>- JSC::VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- auto wrapper = JSC::jsDynamicCast<JSWrapper*>(state.thisValue());
- if (UNLIKELY(!wrapper))
- return throwThisTypeError(state, scope, JSWrapper::info()->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(&state, scope);
</del><ins>+ return throwTypeError(&state, scope, ASCIILiteral("Cannot call callback"));
</ins><span class="cx">
</span><del>- auto iterator = wrapper->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->globalObject(), arguments, value);
- arguments.append(wrapper);
</del><ins>+ appendForEachArguments(state, thisObject.globalObject(), arguments, value);
+ arguments.append(&thisObject);
</ins><span class="cx"> JSC::call(&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<typename JSWrapper>
</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->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($serializerFunctionName);
</span><span class="cx">
</span><span class="cx"> AddToImplIncludes("ObjectConstructor.h");
</span><del>- push(@implContent, "EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n");
</del><ins>+ push(@implContent, "static inline EncodedJSValue ${serializerNativeFunctionName}Caller(ExecState* state, JS$interfaceName* thisObject, JSC::ThrowScope& throwScope)\n");
</ins><span class="cx"> push(@implContent, "{\n");
</span><del>- push(@implContent, " ASSERT(state);\n");
- push(@implContent, " auto thisValue = state->thisValue();\n");
- push(@implContent, " auto castedThis = jsDynamicCast<JS$interfaceName*>(thisValue);\n");
- push(@implContent, " VM& vm = state->vm();\n");
- push(@implContent, " auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
- push(@implContent, " if (UNLIKELY(!castedThis))\n");
- push(@implContent, " return throwThisTypeError(*state, throwScope, \"$interfaceName\", \"$serializerFunctionName\");\n");
- push(@implContent, " ASSERT_GC_OBJECT_INHERITS(castedThis, ${className}::info());\n\n") unless $interfaceName eq "EventTarget";
</del><ins>+ push(@implContent, " auto& vm = state->vm();\n");
</ins><span class="cx"> push(@implContent, " auto* result = constructEmptyObject(state);\n");
</span><ins>+ push(@implContent, "\n");
</ins><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="cx"> my $name = $attribute->signature->name;
</span><span class="cx"> if (grep $_ eq $name, @{$interface->serializable->attributes}) {
</span><span class="cx"> my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><del>- push(@implContent, " auto ${name}Value = ${getFunctionName}(state, JSValue::encode(thisValue), Identifier());\n");
</del><ins>+ push(@implContent, " auto ${name}Value = ${getFunctionName}Getter(*state, *thisObject, throwScope);\n");
</ins><span class="cx"> push(@implContent, " ASSERT(!throwScope.exception());\n");
</span><del>- push(@implContent, " result->putDirect(vm, Identifier::fromString(&vm, \"${name}\"), JSValue::decode(${name}Value));\n");
</del><ins>+ push(@implContent, " result->putDirect(vm, Identifier::fromString(&vm, \"${name}\"), ${name}Value);\n");
+ push(@implContent, "\n");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, " return JSValue::encode(result);\n");
</span><del>- push(@implContent, "}\n\n");
</del><ins>+ push(@implContent, "}\n");
+ push(@implContent, "\n");
+ push(@implContent, "EncodedJSValue JSC_HOST_CALL ${serializerNativeFunctionName}(ExecState* state)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return BindingCaller<JS$interfaceName>::callOperation<${serializerNativeFunctionName}Caller>(state, \"$serializerFunctionName\");\n");
+ push(@implContent, "}\n");
+ push(@implContent, "\n");
</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->signature->name;
</span><span class="cx"> my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx">
</span><del>- if (not $propertyName eq "forEach") {
</del><ins>+ if ($propertyName eq "forEach") {
+ push(@implContent, <<END);
+static inline EncodedJSValue ${functionName}Caller(ExecState* state, JS$interfaceName* thisObject, JSC::ThrowScope& throwScope)
+{
+ return JSValue::encode(iteratorForEach<${className}>(*state, *thisObject, throwScope));
+}
+
+END
+ } else {
</ins><span class="cx"> my $iterationKind = "KeyValue";
</span><span class="cx"> $iterationKind = "Key" if $propertyName eq "keys";
</span><span class="cx"> $iterationKind = "Value" if $propertyName eq "values";
</span><span class="cx"> $iterationKind = "Value" if $propertyName eq "[Symbol.Iterator]" and not $interface->iterable->isKeyValue;
</span><ins>+
</ins><span class="cx"> push(@implContent, <<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&)
</ins><span class="cx"> {
</span><del>- return iteratorCreate<${className}>(*state, IterationKind::${iterationKind}, "${propertyName}");
</del><ins>+ return JSValue::encode(iteratorCreate<${className}>(*thisObject, IterationKind::${iterationKind}));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> END
</span><del>- } else {
- push(@implContent, <<END);
</del><ins>+ }
+
+ push(@implContent, <<END);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorForEach<${className}>(*state, "${propertyName}");
</del><ins>+ return BindingCaller<$className>::callOperation<${functionName}Caller>(state, "${propertyName}");
</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<>
</span><span class="cx"> const JSC::ClassInfo TestIterableIteratorPrototype::s_info = { "TestIterable Iterator", &Base::s_info, 0, CREATE_METHOD_TABLE(TestIterableIteratorPrototype) };
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionSymbolIteratorCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestIterable>(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionSymbolIterator(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestIterable>(*state, IterationKind::Value, "[Symbol.Iterator]");
</del><ins>+ return BindingCaller<JSTestIterable>::callOperation<jsTestIterablePrototypeFunctionSymbolIteratorCaller>(state, "[Symbol.Iterator]");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionEntriesCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestIterable>(*thisObject, IterationKind::KeyValue));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionEntries(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestIterable>(*state, IterationKind::KeyValue, "entries");
</del><ins>+ return BindingCaller<JSTestIterable>::callOperation<jsTestIterablePrototypeFunctionEntriesCaller>(state, "entries");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionKeysCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestIterable>(*thisObject, IterationKind::Key));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionKeys(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestIterable>(*state, IterationKind::Key, "keys");
</del><ins>+ return BindingCaller<JSTestIterable>::callOperation<jsTestIterablePrototypeFunctionKeysCaller>(state, "keys");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionValuesCaller(ExecState*, JSTestIterable* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestIterable>(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionValues(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestIterable>(*state, IterationKind::Value, "values");
</del><ins>+ return BindingCaller<JSTestIterable>::callOperation<jsTestIterablePrototypeFunctionValuesCaller>(state, "values");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestIterablePrototypeFunctionForEachCaller(ExecState* state, JSTestIterable* thisObject, JSC::ThrowScope& throwScope)
+{
+ return JSValue::encode(iteratorForEach<JSTestIterable>(*state, *thisObject, throwScope));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestIterablePrototypeFunctionForEach(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorForEach<JSTestIterable>(*state, "forEach");
</del><ins>+ return BindingCaller<JSTestIterable>::callOperation<jsTestIterablePrototypeFunctionForEachCaller>(state, "forEach");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool JSTestIterableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& 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<>
</span><span class="cx"> const JSC::ClassInfo TestNodeIteratorPrototype::s_info = { "TestNode Iterator", &Base::s_info, 0, CREATE_METHOD_TABLE(TestNodeIteratorPrototype) };
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionSymbolIteratorCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestNode>(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionSymbolIterator(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestNode>(*state, IterationKind::Value, "[Symbol.Iterator]");
</del><ins>+ return BindingCaller<JSTestNode>::callOperation<jsTestNodePrototypeFunctionSymbolIteratorCaller>(state, "[Symbol.Iterator]");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionEntriesCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestNode>(*thisObject, IterationKind::KeyValue));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionEntries(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestNode>(*state, IterationKind::KeyValue, "entries");
</del><ins>+ return BindingCaller<JSTestNode>::callOperation<jsTestNodePrototypeFunctionEntriesCaller>(state, "entries");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionKeysCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestNode>(*thisObject, IterationKind::Key));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionKeys(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestNode>(*state, IterationKind::Key, "keys");
</del><ins>+ return BindingCaller<JSTestNode>::callOperation<jsTestNodePrototypeFunctionKeysCaller>(state, "keys");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionValuesCaller(ExecState*, JSTestNode* thisObject, JSC::ThrowScope&)
+{
+ return JSValue::encode(iteratorCreate<JSTestNode>(*thisObject, IterationKind::Value));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionValues(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorCreate<JSTestNode>(*state, IterationKind::Value, "values");
</del><ins>+ return BindingCaller<JSTestNode>::callOperation<jsTestNodePrototypeFunctionValuesCaller>(state, "values");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static inline EncodedJSValue jsTestNodePrototypeFunctionForEachCaller(ExecState* state, JSTestNode* thisObject, JSC::ThrowScope& throwScope)
+{
+ return JSValue::encode(iteratorForEach<JSTestNode>(*state, *thisObject, throwScope));
+}
+
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionForEach(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>- return iteratorForEach<JSTestNode>(*state, "forEach");
</del><ins>+ return BindingCaller<JSTestNode>::callOperation<jsTestNodePrototypeFunctionForEachCaller>(state, "forEach");
</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& throwScope)
</ins><span class="cx"> {
</span><del>- ASSERT(state);
- auto thisValue = state->thisValue();
- auto castedThis = jsDynamicCast<JSTestNode*>(thisValue);
- VM& vm = state->vm();
- auto throwScope = DECLARE_THROW_SCOPE(vm);
- if (UNLIKELY(!castedThis))
- return throwThisTypeError(*state, throwScope, "TestNode", "toJSON");
- ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestNode::info());
</del><ins>+ auto& vm = state->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->putDirect(vm, Identifier::fromString(&vm, "name"), JSValue::decode(nameValue));
</del><ins>+ result->putDirect(vm, Identifier::fromString(&vm, "name"), 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<JSTestNode>::callOperation<jsTestNodePrototypeFunctionToJSONCaller>(state, "toJSON");
+}
+
</ins><span class="cx"> void JSTestNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
</span><span class="cx"> {
</span><span class="cx"> auto* thisObject = jsCast<JSTestNode*>(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& throwScope)
</ins><span class="cx"> {
</span><del>- ASSERT(state);
- auto thisValue = state->thisValue();
- auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
- VM& vm = state->vm();
- auto throwScope = DECLARE_THROW_SCOPE(vm);
- if (UNLIKELY(!castedThis))
- return throwThisTypeError(*state, throwScope, "TestObj", "toJSON");
- ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</del><ins>+ auto& vm = state->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->putDirect(vm, Identifier::fromString(&vm, "readOnlyStringAttr"), JSValue::decode(readOnlyStringAttrValue));
- auto enumAttrValue = jsTestObjEnumAttr(state, JSValue::encode(thisValue), Identifier());
</del><ins>+ result->putDirect(vm, Identifier::fromString(&vm, "readOnlyStringAttr"), readOnlyStringAttrValue);
+
+ auto enumAttrValue = jsTestObjEnumAttrGetter(*state, *thisObject, throwScope);
</ins><span class="cx"> ASSERT(!throwScope.exception());
</span><del>- result->putDirect(vm, Identifier::fromString(&vm, "enumAttr"), JSValue::decode(enumAttrValue));
- auto longAttrValue = jsTestObjLongAttr(state, JSValue::encode(thisValue), Identifier());
</del><ins>+ result->putDirect(vm, Identifier::fromString(&vm, "enumAttr"), enumAttrValue);
+
+ auto longAttrValue = jsTestObjLongAttrGetter(*state, *thisObject, throwScope);
</ins><span class="cx"> ASSERT(!throwScope.exception());
</span><del>- result->putDirect(vm, Identifier::fromString(&vm, "longAttr"), JSValue::decode(longAttrValue));
- auto createValue = jsTestObjCreate(state, JSValue::encode(thisValue), Identifier());
</del><ins>+ result->putDirect(vm, Identifier::fromString(&vm, "longAttr"), longAttrValue);
+
+ auto createValue = jsTestObjCreateGetter(*state, *thisObject, throwScope);
</ins><span class="cx"> ASSERT(!throwScope.exception());
</span><del>- result->putDirect(vm, Identifier::fromString(&vm, "create"), JSValue::decode(createValue));
</del><ins>+ result->putDirect(vm, Identifier::fromString(&vm, "create"), 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<JSTestObj>::callOperation<jsTestObjPrototypeFunctionToJSONCaller>(state, "toJSON");
+}
+
</ins><span class="cx"> void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
</span><span class="cx"> {
</span><span class="cx"> auto* thisObject = jsCast<JSTestObj*>(cell);
</span></span></pre>
</div>
</div>
</body>
</html>