<!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>[190155] trunk</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/190155">190155</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2015-09-23 00:24:42 -0700 (Wed, 23 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Streams API] Implement ReadableStream pipeThrough
https://bugs.webkit.org/show_bug.cgi?id=147556

Reviewed by Darin Adler.

Source/JavaScriptCore:

Updating BuiltIns infrastructure to make it reusable from WebCore.
Extracting macros from BuiltinNames and createBuiltinExecutable from BuiltinExecutables.
Updated generate-js-builtins to allow generating builtin CPP/H files in WebCore namespace.

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createDefaultConstructor):
(JSC::BuiltinExecutables::createBuiltinExecutable):
(JSC::createBuiltinExecutable):
(JSC::createExecutableInternal):
* builtins/BuiltinExecutables.h:
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames): Deleted.
* builtins/BuiltinUtils.h: Extracting code from BuiltinNames and BuiltinExecutables.h.
* bytecode/UnlinkedFunctionExecutable.h:
* generate-js-builtins:
(getFunctions):
(writeIncludeDirectives):

Source/WebCore:

Adding initial support for JS builtins within WebCore.
This patch allows implementing IDL interface methods in JS, by using the new JSBuiltin keyword.
(No support yet for private identifiers, constructors or accessors).
Integration of the built-in executables and names is implemented within WebCoreJSClientData.
Two files are generated for each JS builtin file:
- builtin h/cpp files similar to JSCBuiltins.cpp/.h, generated through WebCore/generate-js-builtins from JavaScriptCore/generate-js-builtins)
- A builtin wrapper file mimicking BuiltinExecutables (generated from WebCore/generate-js-builtins)
Contrary to JSC, each js file is generating its own cpp/h file.
This allows including those files within the JSXX.cpp/.h files generated from the IDL where compilation guard may take effect.

Disabled GObject binding for JSBuiltin methods.

Test: streams/readable-stream-pipeThrough.html

* CMakeLists.txt: Triggering generate-js-builtins for JS files.
* DerivedSources.make: Ditto.
* ForwardingHeaders/builtins/BuiltinUtils.h: Added.
* ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Added.
* ForwardingHeaders/runtime/ConstructAbility.h: Added.
* Modules/streams/ReadableStream.idl: Marking pipeThrough as JS builtin
* Modules/streams/ReadableStream.js: Added.
(pipeThrough):
* bindings/js/JSReadableStreamCustom.cpp:
* bindings/js/WebCoreJSClientData.h: Adding ReadableStreamBuiltinsWrapper to store ReadableStream builtin executable
(WebCore::WebCoreJSClientData::WebCoreJSClientData):
(WebCore::WebCoreJSClientData::readableStreamBuiltins):
(WebCore::initNormalWorldClientData):
* bindings/scripts/CodeGeneratorGObject.pm: Disabled GObject binding for JSBuiltin methods.
* bindings/scripts/CodeGeneratorJS.pm: Adding support for JSBuiltin keyword.
(GetFunctionName):
(GenerateHeader):
(GenerateImplementation):
(GenerateHashTableValueArray):
(ComputeFunctionSpecial):
(UseJSBuiltins):
* bindings/scripts/IDLAttributes.txt: Adding JSBuiltin.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_js_builtin_method):
(webkit_dom_test_obj_js_builtin_method_with_args):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj jsBuiltinMethod]):
(-[DOMTestObj jsBuiltinMethodWithArgs:strArg:objArg:]):
* bindings/scripts/test/TestObj.idl:
* generate-js-builtins: Added.

LayoutTests:

Rebased test that is now passing.
Adding new tests to improve pipeThrough coverage.

* streams/readable-stream-pipeThrough-expected.txt: Added.
* streams/readable-stream-pipeThrough.html: Added.
* streams/reference-implementation/brand-checks-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationbrandchecksexpectedtxt">trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinExecutablescpp">trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinExecutablesh">trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinNamesh">trunk/Source/JavaScriptCore/builtins/BuiltinNames.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoregeneratejsbuiltins">trunk/Source/JavaScriptCore/generate-js-builtins</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamidl">trunk/Source/WebCore/Modules/streams/ReadableStream.idl</a></li>
<li><a href="#trunkSourceWebCorePlatformWincmake">trunk/Source/WebCore/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamCustomcpp">trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreJSClientDatah">trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstreamsreadablestreampipeThroughexpectedtxt">trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsreadablestreampipeThroughhtml">trunk/LayoutTests/streams/readable-stream-pipeThrough.html</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinUtilsh">trunk/Source/JavaScriptCore/builtins/BuiltinUtils.h</a></li>
<li>trunk/Source/WebCore/ForwardingHeaders/builtins/</li>
<li><a href="#trunkSourceWebCoreForwardingHeadersbuiltinsBuiltinUtilsh">trunk/Source/WebCore/ForwardingHeaders/builtins/BuiltinUtils.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersbytecodeUnlinkedFunctionExecutableh">trunk/Source/WebCore/ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersruntimeConstructAbilityh">trunk/Source/WebCore/ForwardingHeaders/runtime/ConstructAbility.h</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamjs">trunk/Source/WebCore/Modules/streams/ReadableStream.js</a></li>
<li><a href="#trunkSourceWebCoregeneratejsbuiltins">trunk/Source/WebCore/generate-js-builtins</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/LayoutTests/ChangeLog        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-09-23  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Streams API] Implement ReadableStream pipeThrough
+        https://bugs.webkit.org/show_bug.cgi?id=147556
+
+        Reviewed by Darin Adler.
+
+        Rebased test that is now passing.
+        Adding new tests to improve pipeThrough coverage.
+
+        * streams/readable-stream-pipeThrough-expected.txt: Added.
+        * streams/readable-stream-pipeThrough.html: Added.
+        * streams/reference-implementation/brand-checks-expected.txt:
+
</ins><span class="cx"> 2015-09-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Event fired on a detached node does not bubble up
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreadablestreampipeThroughexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt                                (rev 0)
+++ trunk/LayoutTests/streams/readable-stream-pipeThrough-expected.txt        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+PASS ReadableStream.prototype.pipeThrough should throw when &quot;this&quot; has no pipeTo method 
+PASS ReadableStream.prototype.pipeThrough should throw when passed argument is not an object 
+PASS ReadableStream.prototype.pipeThrough should throw when called getters are throwing 
+PASS ReadableStream.prototype.pipeThrough should work with missing parameters 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstreamsreadablestreampipeThroughhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/streams/readable-stream-pipeThrough.html (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/readable-stream-pipeThrough.html                                (rev 0)
+++ trunk/LayoutTests/streams/readable-stream-pipeThrough.html        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script src='../resources/testharness.js'&gt;&lt;/script&gt;
+&lt;script src='../resources/testharnessreport.js'&gt;&lt;/script&gt;
+&lt;script src='../resources/gc.js'&gt;&lt;/script&gt;
+&lt;script&gt;
+
+test(function() {
+    var input = {
+        readable: { },
+        writable: { }
+    };
+    var options = { };
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(undefined, input, options); });
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(null, input, options); });
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(1, input, options); });
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call({ &quot;pipeTo&quot;: &quot;test&quot; }, input, options); });
+}, 'ReadableStream.prototype.pipeThrough should throw when &quot;this&quot; has no pipeTo method');
+
+test(function() {
+    var options = { };
+    var thisValue = {
+        pipeTo: function() {
+            assert_unreached();
+        }
+    };
+
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(thisValue, null, options); });
+    assert_throws(new TypeError(), function() { ReadableStream.prototype.pipeThrough.call(thisValue, undefined, options); });
+}, 'ReadableStream.prototype.pipeThrough should throw when passed argument is not an object');
+
+test(function() {
+    var options = { };
+    var error = new TypeError(&quot;potato&quot;);
+
+    var thisWrongValue = {
+        get pipeTo() {
+            throw error;
+        }
+    };
+    assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisWrongValue, { readable: { }, writable: { } }, options); });
+
+    var thisValue = {
+        pipeTo: function() {
+            assert_unreached();
+        }
+    };
+    var wrongInput = {
+        readable: { },
+        get writable() {
+            throw error;
+        }
+    };
+    assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisValue, wrongInput, options); });
+
+    var wrongInput2 = {
+        get readable() {
+            throw error;
+        },
+        writable: { }
+    };
+    var thisValue2 = {
+        pipeTo: function() { }
+    };
+    assert_throws(error, function() { ReadableStream.prototype.pipeThrough.call(thisValue2, wrongInput2, options); });
+}, 'ReadableStream.prototype.pipeThrough should throw when called getters are throwing');
+
+test(function() {
+    var count = 0;
+    var thisValue = {
+        pipeTo: function() {
+            ++count;
+        }
+    };
+
+    ReadableStream.prototype.pipeThrough.call(thisValue, { readable: { }, writable: { } });
+    ReadableStream.prototype.pipeThrough.call(thisValue, { readable: { } }, { });
+    ReadableStream.prototype.pipeThrough.call(thisValue, { writable: { } }, { });
+
+    assert_equals(count, 3);
+}, 'ReadableStream.prototype.pipeThrough should work with missing parameters');
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationbrandchecksexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/LayoutTests/streams/reference-implementation/brand-checks-expected.txt        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS Can get the ReadableStreamReader constructor indirectly 
</span><span class="cx"> PASS Can get the ReadableStreamController constructor indirectly 
</span><del>-FAIL ReadableStream.prototype.pipeThrough works generically on its this and its arguments Can only call ReadableStream.pipeThrough on instances of ReadableStream
</del><ins>+PASS ReadableStream.prototype.pipeThrough works generically on its this and its arguments 
</ins><span class="cx"> PASS ReadableStreamReader enforces a brand check on its argument 
</span><span class="cx"> FAIL ReadableStreamReader.prototype.closed enforces a brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(obj, getterName).get')
</span><span class="cx"> PASS ReadableStreamReader.prototype.cancel enforces a brand check 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -948,6 +948,7 @@
</span><span class="cx">     API
</span><span class="cx">     assembler
</span><span class="cx">     bindings
</span><ins>+    builtins
</ins><span class="cx">     bytecode
</span><span class="cx">     debugger
</span><span class="cx">     dfg
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-09-23  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Streams API] Implement ReadableStream pipeThrough
+        https://bugs.webkit.org/show_bug.cgi?id=147556
+
+        Reviewed by Darin Adler.
+
+        Updating BuiltIns infrastructure to make it reusable from WebCore.
+        Extracting macros from BuiltinNames and createBuiltinExecutable from BuiltinExecutables.
+        Updated generate-js-builtins to allow generating builtin CPP/H files in WebCore namespace.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * builtins/BuiltinExecutables.cpp:
+        (JSC::BuiltinExecutables::createDefaultConstructor):
+        (JSC::BuiltinExecutables::createBuiltinExecutable):
+        (JSC::createBuiltinExecutable):
+        (JSC::createExecutableInternal):
+        * builtins/BuiltinExecutables.h:
+        * builtins/BuiltinNames.h:
+        (JSC::BuiltinNames::BuiltinNames): Deleted.
+        * builtins/BuiltinUtils.h: Extracting code from BuiltinNames and BuiltinExecutables.h.
+        * bytecode/UnlinkedFunctionExecutable.h:
+        * generate-js-builtins:
+        (getFunctions):
+        (writeIncludeDirectives):
+
</ins><span class="cx"> 2015-09-22  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Gardening: speculative non-JIT build fix after r189999.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -952,6 +952,7 @@
</span><span class="cx">                 2AF7382D18BBBF92008A5A37 /* StructureIDTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AF7382B18BBBF92008A5A37 /* StructureIDTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 371D842D17C98B6E00ECF994 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; };
</span><span class="cx">                 41359CF30FDD89AD00206180 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; };
</span><ins>+                41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DEA1311B9F3154006D65DD /* BuiltinUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 4340A4841A9051AF00D73CCA /* MathCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4340A4821A9051AF00D73CCA /* MathCommon.cpp */; };
</span><span class="cx">                 4340A4851A9051AF00D73CCA /* MathCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 4340A4831A9051AF00D73CCA /* MathCommon.h */; };
</span><span class="cx">                 4443AE3316E188D90076F110 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
</span><span class="lines">@@ -2763,6 +2764,7 @@
</span><span class="cx">                 2AF7382A18BBBF92008A5A37 /* StructureIDTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureIDTable.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2AF7382B18BBBF92008A5A37 /* StructureIDTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureIDTable.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 371D842C17C98B6E00ECF994 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = &quot;compiled.mach-o.dylib&quot;; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
</span><ins>+                41DEA1311B9F3154006D65DD /* BuiltinUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltinUtils.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 4340A4821A9051AF00D73CCA /* MathCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathCommon.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4340A4831A9051AF00D73CCA /* MathCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathCommon.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5871,6 +5873,7 @@
</span><span class="cx">                                 A7D801A11880D66E0026C39B /* BuiltinExecutables.cpp */,
</span><span class="cx">                                 A7D801A21880D66E0026C39B /* BuiltinExecutables.h */,
</span><span class="cx">                                 A75EE9B018AAB7E200AAD043 /* BuiltinNames.h */,
</span><ins>+                                41DEA1311B9F3154006D65DD /* BuiltinUtils.h */,
</ins><span class="cx">                                 A7A979C418BE8D9E002C3733 /* Function.prototype.js */,
</span><span class="cx">                                 7CF9BC5A1B65D9A3009DB1EF /* GlobalObject.js */,
</span><span class="cx">                                 E35E03611B7AB4850073AD2A /* InspectorInstrumentationObject.js */,
</span><span class="lines">@@ -6143,6 +6146,7 @@
</span><span class="cx">                                 A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */,
</span><span class="cx">                                 A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */,
</span><span class="cx">                                 A1B9E23C1B4E0D6700BC7FED /* IntlCollatorConstructor.h in Headers */,
</span><ins>+                                41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */,
</ins><span class="cx">                                 0F620177143FCD3F0068B77C /* DFGAbstractValue.h in Headers */,
</span><span class="cx">                                 0FF054FA1AC35B4400E5BE57 /* ExecutableAllocationFuzz.h in Headers */,
</span><span class="cx">                                 0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinExecutablescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+static UnlinkedFunctionExecutable* createExecutableInternal(VM&amp;, const SourceCode&amp;, const Identifier&amp;, ConstructorKind, ConstructAbility);
+
</ins><span class="cx"> BuiltinExecutables::BuiltinExecutables(VM&amp; vm)
</span><span class="cx">     : m_vm(vm)
</span><span class="cx"> #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(makeSource(StringImpl::createFromLiteral(s_##name, length)))
</span><span class="lines">@@ -52,16 +54,26 @@
</span><span class="cx">     case ConstructorKind::None:
</span><span class="cx">         break;
</span><span class="cx">     case ConstructorKind::Base:
</span><del>-        return createExecutableInternal(makeSource(baseConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);
</del><ins>+        return createExecutableInternal(m_vm, makeSource(baseConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);
</ins><span class="cx">     case ConstructorKind::Derived:
</span><del>-        return createExecutableInternal(makeSource(derivedConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);
</del><ins>+        return createExecutableInternal(m_vm, makeSource(derivedConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedFunctionExecutable* BuiltinExecutables::createExecutableInternal(const SourceCode&amp; source, const Identifier&amp; name, ConstructorKind constructorKind, ConstructAbility constructAbility)
</del><ins>+UnlinkedFunctionExecutable* BuiltinExecutables::createBuiltinExecutable(const SourceCode&amp; code, const Identifier&amp; name, ConstructAbility constructAbility)
</ins><span class="cx"> {
</span><ins>+    return createExecutableInternal(m_vm, code, name, ConstructorKind::None, constructAbility);
+}
+
+UnlinkedFunctionExecutable* createBuiltinExecutable(VM&amp; vm, const SourceCode&amp; code, const Identifier&amp; name, ConstructAbility constructAbility)
+{
+    return createExecutableInternal(vm, code, name, ConstructorKind::None, constructAbility);
+}
+
+UnlinkedFunctionExecutable* createExecutableInternal(VM&amp; vm, const SourceCode&amp; source, const Identifier&amp; name, ConstructorKind constructorKind, ConstructAbility constructAbility)
+{
</ins><span class="cx">     JSTextPosition positionBeforeLastNewline;
</span><span class="cx">     ParserError error;
</span><span class="cx">     bool isParsingDefaultConstructor = constructorKind != ConstructorKind::None;
</span><span class="lines">@@ -69,7 +81,7 @@
</span><span class="cx">     UnlinkedFunctionKind kind = isParsingDefaultConstructor ? UnlinkedNormalFunction : UnlinkedBuiltinFunction;
</span><span class="cx">     RefPtr&lt;SourceProvider&gt; sourceOverride = isParsingDefaultConstructor ? source.provider() : nullptr;
</span><span class="cx">     std::unique_ptr&lt;ProgramNode&gt; program = parse&lt;ProgramNode&gt;(
</span><del>-        &amp;m_vm, source, Identifier(), builtinMode,
</del><ins>+        &amp;vm, source, Identifier(), builtinMode,
</ins><span class="cx">         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error,
</span><span class="cx">         &amp;positionBeforeLastNewline, constructorKind);
</span><span class="cx"> 
</span><span class="lines">@@ -95,16 +107,16 @@
</span><span class="cx">     metadata-&gt;setEndPosition(positionBeforeLastNewline);
</span><span class="cx">     RELEASE_ASSERT(metadata);
</span><span class="cx">     for (const auto&amp; closedVariable : program-&gt;closedVariables()) {
</span><del>-        if (closedVariable == m_vm.propertyNames-&gt;arguments.impl())
</del><ins>+        if (closedVariable == vm.propertyNames-&gt;arguments.impl())
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        if (closedVariable == m_vm.propertyNames-&gt;undefinedKeyword.impl())
</del><ins>+        if (closedVariable == vm.propertyNames-&gt;undefinedKeyword.impl())
</ins><span class="cx">             continue;
</span><span class="cx">     }
</span><span class="cx">     metadata-&gt;overrideName(name);
</span><span class="cx">     VariableEnvironment dummyTDZVariables;
</span><del>-    UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&amp;m_vm, source, metadata, kind, constructAbility, dummyTDZVariables, WTF::move(sourceOverride));
-    functionExecutable-&gt;m_nameValue.set(m_vm, functionExecutable, jsString(&amp;m_vm, name.string()));
</del><ins>+    UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&amp;vm, source, metadata, kind, constructAbility, dummyTDZVariables, WTF::move(sourceOverride));
+    functionExecutable-&gt;setNameValue(vm, jsString(&amp;vm, name.string()));
</ins><span class="cx">     return functionExecutable;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinExecutablesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -57,11 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     VM&amp; m_vm;
</span><span class="cx"> 
</span><del>-    UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&amp; code, const Identifier&amp; name, ConstructAbility constructAbility)
-    {
-        return createExecutableInternal(code, name, ConstructorKind::None, constructAbility);
-    }
-    UnlinkedFunctionExecutable* createExecutableInternal(const SourceCode&amp;, const Identifier&amp;, ConstructorKind, ConstructAbility);
</del><ins>+    UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&amp;, const Identifier&amp;, ConstructAbility);
</ins><span class="cx"> 
</span><span class="cx"> #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length)\
</span><span class="cx">     SourceCode m_##name##Source; \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinNames.h (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinNames.h        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinNames.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -26,42 +26,31 @@
</span><span class="cx"> #ifndef BuiltinNames_h
</span><span class="cx"> #define BuiltinNames_h
</span><span class="cx"> 
</span><ins>+#include &quot;BuiltinUtils.h&quot;
</ins><span class="cx"> #include &quot;CommonIdentifiers.h&quot;
</span><span class="cx"> #include &quot;JSCBuiltins.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><del>-    
-#define INITIALISE_BUILTIN_NAMES(name) , m_##name(Identifier::fromString(vm, #name)), m_##name##PrivateName(Identifier::fromUid(PrivateName(PrivateName::Description, ASCIILiteral(&quot;PrivateSymbol.&quot; #name))))
-#define DECLARE_BUILTIN_NAMES(name) const Identifier m_##name; const Identifier m_##name##PrivateName;
-#define DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \
-    const Identifier&amp; name##PublicName() const { return m_##name; } \
-    const Identifier&amp; name##PrivateName() const { return m_##name##PrivateName; }
</del><span class="cx"> 
</span><del>-#define INITIALISE_BUILTIN_SYMBOLS(name) INITIALISE_BUILTIN_NAMES(name), m_##name##Symbol(Identifier::fromUid(PrivateName(PrivateName::Description, ASCIILiteral(&quot;Symbol.&quot; #name))))
-#define DECLARE_BUILTIN_SYMBOLS(name) DECLARE_BUILTIN_NAMES(name) const Identifier m_##name##Symbol;
-#define DECLARE_BUILTIN_SYMBOL_ACCESSOR(name) \
-    DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \
-    const Identifier&amp; name##Symbol() const { return m_##name##Symbol; }
</del><ins>+#define INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY(name) m_privateToPublicMap.add(m_##name##PrivateName.impl(), &amp;m_##name);
+#define INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY(name) m_publicToPrivateMap.add(m_##name.impl(), &amp;m_##name##PrivateName);
</ins><span class="cx"> 
</span><del>-#define INITIALISE_PRIVATE_TO_PUBLIC_ENTRY(name) m_privateToPublicMap.add(m_##name##PrivateName.impl(), &amp;m_##name);
-#define INITIALISE_PUBLIC_TO_PRIVATE_ENTRY(name) m_publicToPrivateMap.add(m_##name.impl(), &amp;m_##name##PrivateName);
-    
</del><span class="cx"> class BuiltinNames {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(BuiltinNames); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     
</span><span class="cx"> public:
</span><span class="cx">     BuiltinNames(VM* vm, CommonIdentifiers* commonIdentifiers)
</span><span class="cx">         : m_emptyIdentifier(commonIdentifiers-&gt;emptyIdentifier)
</span><del>-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALISE_BUILTIN_NAMES)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALISE_BUILTIN_NAMES)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALISE_BUILTIN_SYMBOLS)
</del><ins>+        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_BUILTIN_NAMES)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_BUILTIN_SYMBOLS)
</ins><span class="cx">     {
</span><del>-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALISE_PRIVATE_TO_PUBLIC_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALISE_PRIVATE_TO_PUBLIC_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALISE_PRIVATE_TO_PUBLIC_ENTRY)
-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALISE_PUBLIC_TO_PRIVATE_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALISE_PUBLIC_TO_PRIVATE_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALISE_PUBLIC_TO_PRIVATE_ENTRY)
</del><ins>+        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
+        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
+        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isPrivateName(SymbolImpl&amp; uid) const;
</span><span class="lines">@@ -84,13 +73,6 @@
</span><span class="cx">     BuiltinNamesMap m_privateToPublicMap;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#undef DECLARE_BUILTIN_NAMES
-#undef INITIALISE_BUILTIN_NAMES
-#undef DECLARE_BUILTIN_IDENTIFIER_ACCESSOR
-#undef DECLARE_BUILTIN_SYMBOLS
-#undef INITIALISE_BUILTIN_SYMBOLS
-#undef DECLARE_BUILTIN_SYMBOL_ACCESSOR
-
</del><span class="cx"> inline bool BuiltinNames::isPrivateName(SymbolImpl&amp; uid) const
</span><span class="cx"> {
</span><span class="cx">     return m_privateToPublicMap.contains(&amp;uid);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinUtilshfromrev190154trunkSourceJavaScriptCorebuiltinsBuiltinExecutablesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/builtins/BuiltinUtils.h (from rev 190154, trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.h) (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinUtils.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinUtils.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2015 Canon Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BuiltinUtils_h
+#define BuiltinUtils_h
+
+#include &quot;ConstructAbility.h&quot;
+
+namespace JSC {
+
+#define INITIALIZE_BUILTIN_NAMES(name) , m_##name(JSC::Identifier::fromString(vm, #name)), m_##name##PrivateName(JSC::Identifier::fromUid(JSC::PrivateName(JSC::PrivateName::Description, ASCIILiteral(&quot;PrivateSymbol.&quot; #name))))
+#define DECLARE_BUILTIN_NAMES(name) const JSC::Identifier m_##name; const JSC::Identifier m_##name##PrivateName;
+#define DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \
+    const JSC::Identifier&amp; name##PublicName() const { return m_##name; } \
+    const JSC::Identifier&amp; name##PrivateName() const { return m_##name##PrivateName; }
+
+#define INITIALIZE_BUILTIN_SYMBOLS(name) INITIALIZE_BUILTIN_NAMES(name), m_##name##Symbol(JSC::Identifier::fromUid(JSC::PrivateName(JSC::PrivateName::Description, ASCIILiteral(&quot;Symbol.&quot; #name))))
+#define DECLARE_BUILTIN_SYMBOLS(name) DECLARE_BUILTIN_NAMES(name) const JSC::Identifier m_##name##Symbol;
+#define DECLARE_BUILTIN_SYMBOL_ACCESSOR(name) \
+    DECLARE_BUILTIN_IDENTIFIER_ACCESSOR(name) \
+    const JSC::Identifier&amp; name##Symbol() const { return m_##name##Symbol; }
+
+class Identifier;
+class SourceCode;
+class UnlinkedFunctionExecutable;
+class VM;
+
+JS_EXPORT_PRIVATE UnlinkedFunctionExecutable* createBuiltinExecutable(VM&amp;, const SourceCode&amp;, const Identifier&amp;, ConstructAbility);
+    
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx"> 
</span><span class="cx"> class UnlinkedFunctionExecutable final : public JSCell {
</span><span class="cx"> public:
</span><del>-    friend class BuiltinExecutables;
</del><span class="cx">     friend class CodeCache;
</span><span class="cx">     friend class VM;
</span><span class="cx"> 
</span><span class="lines">@@ -77,6 +76,7 @@
</span><span class="cx">     const Identifier&amp; name() const { return m_name; }
</span><span class="cx">     const Identifier&amp; inferredName() const { return m_inferredName; }
</span><span class="cx">     JSString* nameValue() const { return m_nameValue.get(); }
</span><ins>+    void setNameValue(VM&amp; vm, JSString* nameValue) { m_nameValue.set(vm, this, nameValue); }
</ins><span class="cx">     unsigned parameterCount() const { return m_parameterCount; };
</span><span class="cx">     SourceParseMode parseMode() const { return m_parseMode; };
</span><span class="cx">     bool isInStrictContext() const { return m_isInStrictContext; }
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">         const Identifier&amp;, ExecState&amp;, const SourceCode&amp;, JSObject*&amp; exception, 
</span><span class="cx">         int overrideLineNumber);
</span><span class="cx"> 
</span><del>-    FunctionExecutable* link(VM&amp;, const SourceCode&amp;, int overrideLineNumber = -1);
</del><ins>+    JS_EXPORT_PRIVATE FunctionExecutable* link(VM&amp;, const SourceCode&amp;, int overrideLineNumber = -1);
</ins><span class="cx"> 
</span><span class="cx">     void clearCode()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoregeneratejsbuiltins"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/generate-js-builtins (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/generate-js-builtins        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/JavaScriptCore/generate-js-builtins        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> parser.add_argument('input_file', nargs='*', help='Input JS files which builtins generated from')
</span><span class="cx"> parser.add_argument('--input-directory', help='All JS files will be used as input from this directory.')
</span><span class="cx"> parser.add_argument('--output', help='path to output cpp or h file')
</span><ins>+parser.add_argument('--prefix', default='JSC', help='prefix used for public macros')
+parser.add_argument('--namespace', default='JSC', help='C++ namespace')
</ins><span class="cx"> args = parser.parse_args()
</span><span class="cx"> 
</span><span class="cx"> copyrightText = &quot;&quot;&quot; *
</span><span class="lines">@@ -153,6 +155,9 @@
</span><span class="cx">         result.append(Function(functionName, function, functionIsConstructor, functionParameters))
</span><span class="cx">     return result
</span><span class="cx"> 
</span><ins>+def writeIncludeDirectives(writer, headerNames):
+    for headerName in headerNames:
+        writer.write(&quot;#include &quot; + headerName + &quot;\n&quot;)
</ins><span class="cx"> 
</span><span class="cx"> def generateCode(source):
</span><span class="cx">     inputFile = open(source, &quot;r&quot;)
</span><span class="lines">@@ -179,7 +184,15 @@
</span><span class="cx">         (baseName, functions, objectCopyrights) = generateCode(file)
</span><span class="cx">         copyrights.extend(objectCopyrights)
</span><span class="cx">         builtins.append((baseName, functions))
</span><ins>+namespace = args.namespace
+macroPrefix = args.prefix
+scopeName = os.path.splitext(os.path.basename(args.output))[0]
+includeGuard = scopeName + &quot;_H&quot;
+headerName = scopeName + &quot;.h&quot;
</ins><span class="cx"> 
</span><ins>+headerIncludes = [&quot;\&quot;BuiltinUtils.h\&quot;&quot;] if namespace == &quot;JSC&quot; else [&quot;&lt;builtins/BuiltinUtils.h&gt;&quot;]
+contentIncludes = [&quot;\&quot;BuiltinExecutables.h\&quot;&quot;, &quot;\&quot;Executable.h\&quot;&quot;, &quot;\&quot;JSCellInlines.h\&quot;&quot;, &quot;\&quot;VM.h\&quot;&quot;] if namespace == &quot;JSC&quot; else [&quot;&lt;runtime/Executable.h&gt;&quot;, &quot;&lt;runtime/StructureInlines.h&gt;&quot;, &quot;&lt;runtime/JSCJSValueInlines.h&gt;&quot;, &quot;&lt;runtime/JSCellInlines.h&gt;&quot;, &quot;&lt;runtime/VM.h&gt;&quot;, &quot;\&quot;WebCoreJSClientData.h\&quot;&quot;]
+
</ins><span class="cx"> copyrights = list(set(copyrights))
</span><span class="cx"> 
</span><span class="cx"> copyrightBody = &quot;&quot;
</span><span class="lines">@@ -192,24 +205,22 @@
</span><span class="cx"> builtinsHeader.write(&quot;&quot;&quot;%s
</span><span class="cx"> %s
</span><span class="cx"> 
</span><del>-#ifndef JSCBuiltins_H
-#define JSCBuiltins_H
</del><ins>+#ifndef %s
+#define %s
</ins><span class="cx"> 
</span><del>-#include &quot;ConstructAbility.h&quot;
</del><ins>+&quot;&quot;&quot; % (generatorString, copyrightText, includeGuard, includeGuard))
</ins><span class="cx"> 
</span><ins>+writeIncludeDirectives(builtinsHeader, headerIncludes)
+
+builtinsHeader.write(&quot;&quot;&quot;
</ins><span class="cx"> namespace JSC {
</span><ins>+    class FunctionExecutable;
+}
</ins><span class="cx"> 
</span><del>-class FunctionExecutable;
-class Identifier;
-class JSGlobalObject;
-class SourceCode;
-class UnlinkedFunctionExecutable;
-class VM;
</del><ins>+namespace %s {
</ins><span class="cx"> 
</span><del>-FunctionExecutable* createBuiltinExecutable(VM&amp;, UnlinkedFunctionExecutable*, const SourceCode&amp;);
</del><ins>+&quot;&quot;&quot; % namespace)
</ins><span class="cx"> 
</span><del>-&quot;&quot;&quot; % (generatorString, copyrightText))
-
</del><span class="cx"> codeReferences = []
</span><span class="cx"> 
</span><span class="cx"> for (objectName, functions) in builtins:
</span><span class="lines">@@ -222,59 +233,60 @@
</span><span class="cx">         codeReferences.append((mangledName, function))
</span><span class="cx">         builtinsHeader.write(&quot;extern const char* s_%s;\n&quot; % mangledName)
</span><span class="cx">         builtinsHeader.write(&quot;extern const int s_%sLength;\n&quot; % mangledName)
</span><del>-        builtinsHeader.write(&quot;extern const ConstructAbility s_%sConstructAbility;\n&quot; % mangledName)
</del><ins>+        builtinsHeader.write(&quot;extern const JSC::ConstructAbility s_%sConstructAbility;\n&quot; % mangledName)
</ins><span class="cx">     builtinsHeader.write(&quot;\n&quot;)
</span><del>-    builtinsHeader.write(&quot;#define JSC_FOREACH_%s_BUILTIN(macro) \\\n&quot; % objectName.replace(&quot;.&quot;, &quot;_&quot;).upper())
</del><ins>+    builtinsHeader.write(&quot;#define %s_FOREACH_%s_BUILTIN(macro) \\\n&quot; % (macroPrefix, objectName.replace(&quot;.&quot;, &quot;_&quot;).upper()))
</ins><span class="cx">     for function in functions:
</span><span class="cx">         mangledName = function.mangleName(objectName)
</span><span class="cx">         builtinsHeader.write(&quot;    macro(%s, %s, %d) \\\n&quot; % (function.name, mangledName, len(function.parameters)))
</span><span class="cx">     builtinsHeader.write(&quot;\n&quot;)
</span><span class="cx">     for function in functions:
</span><del>-        builtinsHeader.write(&quot;#define JSC_BUILTIN_%s 1\n&quot; % function.mangleName(objectName).upper())
</del><ins>+        builtinsHeader.write(&quot;#define %s_BUILTIN_%s 1\n&quot; % (macroPrefix, function.mangleName(objectName).upper()))
</ins><span class="cx">     builtinsHeader.write(&quot;\n\n&quot;)
</span><span class="cx"> names = []
</span><del>-builtinsHeader.write(&quot;#define JSC_FOREACH_BUILTIN(macro)\\\n&quot;)
</del><ins>+builtinsHeader.write(&quot;#define %s_FOREACH_BUILTIN(macro)\\\n&quot; % macroPrefix)
</ins><span class="cx"> for (codeReference, function) in codeReferences:
</span><span class="cx">     builtinsHeader.write(&quot;    macro(%s, %s, s_%sLength) \\\n&quot; % (codeReference, function.name, codeReference))
</span><span class="cx">     names.append(function.name)
</span><span class="cx"> 
</span><span class="cx"> builtinsHeader.write(&quot;\n\n&quot;)
</span><del>-builtinsHeader.write(&quot;#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \\\n&quot;)
</del><ins>+builtinsHeader.write(&quot;#define %s_FOREACH_BUILTIN_FUNCTION_NAME(macro) \\\n&quot; % macroPrefix)
</ins><span class="cx"> for name in sorted(set(names)):
</span><span class="cx">     builtinsHeader.write(&quot;    macro(%s) \\\n&quot; % name)
</span><span class="cx"> builtinsHeader.write(&quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-#define JSC_DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
-    FunctionExecutable* codeName##Generator(VM&amp;);
</del><ins>+#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
+    JSC::FunctionExecutable* codeName##Generator(JSC::VM&amp;);
</ins><span class="cx"> 
</span><del>-JSC_FOREACH_BUILTIN(JSC_DECLARE_BUILTIN_GENERATOR)
-#undef JSC_DECLARE_BUILTIN_GENERATOR
</del><ins>+%s_FOREACH_BUILTIN(DECLARE_BUILTIN_GENERATOR)
+#undef DECLARE_BUILTIN_GENERATOR
</ins><span class="cx"> 
</span><del>-#define JSC_BUILTIN_EXISTS(name) defined JSC_BUILTIN_ ## name
</del><ins>+#define %s_BUILTIN_EXISTS(name) defined %s_BUILTIN_ ## name
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // %s
</ins><span class="cx"> 
</span><del>-&quot;&quot;&quot;)
</del><ins>+&quot;&quot;&quot; % (macroPrefix, macroPrefix, macroPrefix, includeGuard))
</ins><span class="cx"> 
</span><span class="cx"> builtinsImplementation.write(&quot;&quot;&quot;%s
</span><span class="cx"> %s
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;JSCBuiltins.h&quot;
</del><ins>+#include &quot;%s&quot;
</ins><span class="cx"> 
</span><del>-#include &quot;BuiltinExecutables.h&quot;
-#include &quot;ConstructAbility.h&quot;
-#include &quot;Executable.h&quot;
-#include &quot;JSCellInlines.h&quot;
-#include &quot;VM.h&quot;
</del><ins>+&quot;&quot;&quot;  % (generatorString, copyrightText, headerName))
</ins><span class="cx"> 
</span><del>-namespace JSC {
</del><ins>+writeIncludeDirectives(builtinsImplementation, contentIncludes)
</ins><span class="cx"> 
</span><del>-&quot;&quot;&quot;  % (generatorString, copyrightText))
</del><ins>+builtinsImplementation.write(&quot;&quot;&quot;
+namespace %s {
</ins><span class="cx"> 
</span><ins>+&quot;&quot;&quot;  % (namespace))
+
+
+
</ins><span class="cx"> for (codeReference, function) in codeReferences:
</span><span class="cx">     source = function.source
</span><span class="cx">     source = &quot;(function &quot; + source[source.index(&quot;(&quot;):] + &quot;)&quot;
</span><span class="lines">@@ -285,23 +297,33 @@
</span><span class="cx">         source = source + (&quot;    \&quot;%s\\n\&quot; \\\n&quot; % line)
</span><span class="cx">     builtinsImplementation.write(&quot;const char* s_%s =\n%s;\n\n&quot; % (codeReference, source))
</span><span class="cx">     builtinsImplementation.write(&quot;const int s_%sLength = %d;\n\n&quot; % (codeReference, sourceLength + 1)) # + 1 for \n
</span><del>-    constructAbility = &quot;ConstructAbility::CannotConstruct&quot;
</del><ins>+    constructAbility = &quot;JSC::ConstructAbility::CannotConstruct&quot;
</ins><span class="cx">     if function.isConstructor:
</span><del>-        constructAbility = &quot;ConstructAbility::CanConstruct&quot;
-    builtinsImplementation.write(&quot;const ConstructAbility s_%sConstructAbility = %s;\n\n&quot; % (codeReference, constructAbility)) # + 1 for \n
</del><ins>+        constructAbility = &quot;JSC::ConstructAbility::CanConstruct&quot;
+    builtinsImplementation.write(&quot;const JSC::ConstructAbility s_%sConstructAbility = %s;\n\n&quot; % (codeReference, constructAbility)) # + 1 for \n
</ins><span class="cx"> 
</span><span class="cx"> builtinsImplementation.write(&quot;&quot;&quot;
</span><del>-#define JSC_DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
-FunctionExecutable* codeName##Generator(VM&amp; vm) \\
-{ \\
</del><ins>+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
+JSC::FunctionExecutable* codeName##Generator(JSC::VM&amp; vm) \\
+&quot;&quot;&quot;);
+
+if (namespace == &quot;JSC&quot;):
+    builtinsImplementation.write(&quot;&quot;&quot;{\\
</ins><span class="cx">     return vm.builtinExecutables()-&gt;codeName##Executable()-&gt;link(vm, vm.builtinExecutables()-&gt;codeName##Source()); \\
</span><del>-}
</del><ins>+&quot;&quot;&quot;)
+else:
+    builtinName = scopeName[0].lower() + scopeName[1:]
+    builtinsImplementation.write(&quot;&quot;&quot;{\\
+    WebCoreJSClientData* clientData = static_cast&lt;WebCoreJSClientData*&gt;(vm.clientData); \\
+    return clientData-&gt;%s().codeName##Executable()-&gt;link(vm, clientData-&gt;%s().codeName##Source()); \\
+&quot;&quot;&quot;% (builtinName, builtinName))
</ins><span class="cx"> 
</span><del>-JSC_FOREACH_BUILTIN(JSC_DEFINE_BUILTIN_GENERATOR)
-#undef JSC_DEFINE_BUILTIN_GENERATOR
</del><ins>+builtinsImplementation.write(&quot;&quot;&quot;}
+%s_FOREACH_BUILTIN(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-&quot;&quot;&quot;)
</del><ins>+&quot;&quot;&quot;% (macroPrefix))
</ins><span class="cx"> 
</span><span class="cx"> builtinsHeader.close()
</span><span class="cx"> builtinsImplementation.close()
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -3337,6 +3337,10 @@
</span><span class="cx"> set(DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE ${DERIVED_SOURCES_WEBCORE_DIR}/DedicatedWorkerGlobalScopeConstructors.idl)
</span><span class="cx"> set(IDL_ATTRIBUTES_FILE ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
</span><span class="cx"> 
</span><ins>+set(WEBCORE_JS_BUILTINS
+    ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
+)
+
</ins><span class="cx"> WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
</span><span class="cx"> 
</span><span class="cx"> # Generate InspectorOverlayPage.h
</span><span class="lines">@@ -3556,6 +3560,22 @@
</span><span class="cx">     ${SUPPLEMENTAL_DEPENDENCY_FILE}
</span><span class="cx">     ${ADDITIONAL_BINDINGS_DEPENDENCIES})
</span><span class="cx"> 
</span><ins>+# WebCore JS Builtins
+foreach (_builtinjs ${WEBCORE_JS_BUILTINS})
+    get_filename_component(_name ${_builtinjs} NAME_WE)
+    add_custom_command(
+        OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}BuiltinsWrapper.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.cpp
+        MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins
+        DEPENDS ${JAVASCRIPTCORE_DIR}/generate-js-builtins
+        DEPENDS ${_builtinjs}
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins --input ${_builtinjs} --output_dir ${DERIVED_SOURCES_WEBCORE_DIR} --webcore_dir ${CMAKE_CURRENT_SOURCE_DIR}
+        VERBATIM)
+    list(APPEND WebCore_SOURCES
+        ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.h
+        ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}BuiltinsWrapper.h
+        ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.cpp
+    )
+endforeach ()
</ins><span class="cx"> 
</span><span class="cx"> ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/ChangeLog        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2015-09-23  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Streams API] Implement ReadableStream pipeThrough
+        https://bugs.webkit.org/show_bug.cgi?id=147556
+
+        Reviewed by Darin Adler.
+
+        Adding initial support for JS builtins within WebCore.
+        This patch allows implementing IDL interface methods in JS, by using the new JSBuiltin keyword.
+        (No support yet for private identifiers, constructors or accessors).
+        Integration of the built-in executables and names is implemented within WebCoreJSClientData.
+        Two files are generated for each JS builtin file:
+        - builtin h/cpp files similar to JSCBuiltins.cpp/.h, generated through WebCore/generate-js-builtins from JavaScriptCore/generate-js-builtins)
+        - A builtin wrapper file mimicking BuiltinExecutables (generated from WebCore/generate-js-builtins)
+        Contrary to JSC, each js file is generating its own cpp/h file.
+        This allows including those files within the JSXX.cpp/.h files generated from the IDL where compilation guard may take effect.
+
+        Disabled GObject binding for JSBuiltin methods.
+
+        Test: streams/readable-stream-pipeThrough.html
+
+        * CMakeLists.txt: Triggering generate-js-builtins for JS files.
+        * DerivedSources.make: Ditto.
+        * ForwardingHeaders/builtins/BuiltinUtils.h: Added.
+        * ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h: Added.
+        * ForwardingHeaders/runtime/ConstructAbility.h: Added.
+        * Modules/streams/ReadableStream.idl: Marking pipeThrough as JS builtin
+        * Modules/streams/ReadableStream.js: Added.
+        (pipeThrough):
+        * bindings/js/JSReadableStreamCustom.cpp:
+        * bindings/js/WebCoreJSClientData.h: Adding ReadableStreamBuiltinsWrapper to store ReadableStream builtin executable
+        (WebCore::WebCoreJSClientData::WebCoreJSClientData):
+        (WebCore::WebCoreJSClientData::readableStreamBuiltins):
+        (WebCore::initNormalWorldClientData):
+        * bindings/scripts/CodeGeneratorGObject.pm: Disabled GObject binding for JSBuiltin methods.
+        * bindings/scripts/CodeGeneratorJS.pm: Adding support for JSBuiltin keyword.
+        (GetFunctionName):
+        (GenerateHeader):
+        (GenerateImplementation):
+        (GenerateHashTableValueArray):
+        (ComputeFunctionSpecial):
+        (UseJSBuiltins):
+        * bindings/scripts/IDLAttributes.txt: Adding JSBuiltin.
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        (webkit_dom_test_obj_js_builtin_method):
+        (webkit_dom_test_obj_js_builtin_method_with_args):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        (-[DOMTestObj jsBuiltinMethod]):
+        (-[DOMTestObj jsBuiltinMethodWithArgs:strArg:objArg:]):
+        * bindings/scripts/test/TestObj.idl:
+        * generate-js-builtins: Added.
+
</ins><span class="cx"> 2015-09-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Event fired on a detached node does not bubble up
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/DerivedSources.cpp        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -309,6 +309,7 @@
</span><span class="cx"> #include &quot;JSReadableStream.cpp&quot;
</span><span class="cx"> #include &quot;JSReadableStreamController.cpp&quot;
</span><span class="cx"> #include &quot;JSReadableStreamReader.cpp&quot;
</span><ins>+#include &quot;ReadableStreamBuiltins.cpp&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> #include &quot;JSRect.cpp&quot;
</span><span class="cx"> #include &quot;JSRequestAnimationFrameCallback.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/DerivedSources.make        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -792,6 +792,7 @@
</span><span class="cx">     $(WORKERGLOBALSCOPE_CONSTRUCTORS_FILE) \
</span><span class="cx">     $(JS_DOM_HEADERS) \
</span><span class="cx">     $(WEB_DOM_HEADERS) \
</span><ins>+    $(WEBCORE_JS_BUILTINS) \
</ins><span class="cx">     \
</span><span class="cx">     CSSGrammar.cpp \
</span><span class="cx">     CSSPropertyNames.cpp \
</span><span class="lines">@@ -1246,6 +1247,16 @@
</span><span class="cx"> 
</span><span class="cx"> -include $(JS_DOM_HEADERS:.h=.dep)
</span><span class="cx"> 
</span><ins>+# WebCore JS Builtins
+
+WEBCORE_JS_BUILTINS = \
+    $(WebCore)/Modules/streams/ReadableStream.js
+
+all : $(WEBCORE_JS_BUILTINS:%.js=%Builtins.cpp)
+
+%Builtins.cpp: %.js
+        $(PYTHON) $(WebCore)/generate-js-builtins --input $&lt; --webcore_dir $(WebCore)
+
</ins><span class="cx"> # ------------------------
</span><span class="cx"> 
</span><span class="cx"> # Mac-specific rules
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersbuiltinsBuiltinUtilsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/builtins/BuiltinUtils.h (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/builtins/BuiltinUtils.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/builtins/BuiltinUtils.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_BuiltinUtils_h
+#define WebCore_FWD_BuiltinUtils_h
+#include &lt;JavaScriptCore/BuiltinUtils.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersbytecodeUnlinkedFunctionExecutableh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/bytecode/UnlinkedFunctionExecutable.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_UnlinkedFunctionExecutable_h
+#define WebCore_FWD_UnlinkedFunctionExecutable_h
+#include &lt;JavaScriptCore/UnlinkedFunctionExecutable.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersruntimeConstructAbilityh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/runtime/ConstructAbility.h (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/runtime/ConstructAbility.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/runtime/ConstructAbility.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_ConstructAbility_h
+#define WebCore_FWD_ConstructAbility_h
+#include &lt;JavaScriptCore/ConstructAbility.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     [RaisesException] Promise cancel([Default=Undefined] optional any reason);
</span><span class="cx">     [RaisesException] ReadableStreamReader getReader();
</span><span class="cx">     [Custom] Promise pipeTo(any streams, any options);
</span><del>-    [Custom] Object pipeThrough(any dest, any options);
</del><ins>+    [JSBuiltin] Object pipeThrough(any dest, any options);
</ins><span class="cx"> 
</span><span class="cx">     readonly attribute boolean locked;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/streams/ReadableStream.js (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.js                                (rev 0)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2015 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function pipeThrough(streams, options)
+{
+    &quot;use strict&quot;;
+
+    this.pipeTo(streams.writable, options);
+    return streams.readable;
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorePlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWin.cmake (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWin.cmake        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/PlatformWin.cmake        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/ForwardingHeaders&quot;
</span><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/API&quot;
</span><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/assembler&quot;
</span><ins>+    &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/builtins&quot;
</ins><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/bytecode&quot;
</span><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/bytecompiler&quot;
</span><span class="cx">     &quot;${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/dfg&quot;
</span><span class="lines">@@ -289,4 +290,4 @@
</span><span class="cx"> 
</span><span class="cx"> set(WebCore_OUTPUT_NAME
</span><span class="cx">     WebCore${DEBUG_SUFFIX}
</span><del>-)
</del><span class="cx">\ No newline at end of file
</span><ins>+)
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -3946,6 +3946,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ReadableStreamBuiltins.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStreamController.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -2595,6 +2595,7 @@
</span><span class="cx">                 7C48A6D0191C9D6500026674 /* WebKitNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C48A6CE191C9D6500026674 /* WebKitNamespace.cpp */; };
</span><span class="cx">                 7C48A6D1191C9D6500026674 /* WebKitNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C48A6CF191C9D6500026674 /* WebKitNamespace.h */; };
</span><span class="cx">                 7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85989DCA0ACC8BBD00A0BC51 /* DOMWheelEventInternal.h */; };
</span><ins>+                7C4C96DC1AD4483500365A51 /* ReadableStreamBuiltins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A51 /* ReadableStreamBuiltins.cpp */; };
</ins><span class="cx">                 7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */; };
</span><span class="cx">                 7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A50 /* JSReadableStream.h */; };
</span><span class="cx">                 7C4C96DE1AD4483500365A50 /* JSReadableStreamReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */; };
</span><span class="lines">@@ -9983,6 +9984,7 @@
</span><span class="cx">                 7C48A6CE191C9D6500026674 /* WebKitNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitNamespace.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C48A6CF191C9D6500026674 /* WebKitNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNamespace.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C48A6D2191C9D8E00026674 /* WebKitNamespace.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitNamespace.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C4C96D81AD4483500365A51 /* ReadableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamBuiltins.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStream.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C4C96D91AD4483500365A50 /* JSReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamReader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16207,6 +16209,7 @@
</span><span class="cx">                 41A023FA1A39F13A00F722CF /* Streams */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7C4C96D81AD4483500365A51 /* ReadableStreamBuiltins.cpp */,
</ins><span class="cx">                                 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */,
</span><span class="cx">                                 7C4C96D91AD4483500365A50 /* JSReadableStream.h */,
</span><span class="cx">                                 6C4C96DA1AD4483500365A50 /* JSReadableStreamController.cpp */,
</span><span class="lines">@@ -29399,6 +29402,7 @@
</span><span class="cx">                                 077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */,
</span><span class="cx">                                 B658FFA11522EF3A00DD5595 /* JSRadioNodeList.cpp in Sources */,
</span><span class="cx">                                 65DF320109D1CC60000BE325 /* JSRange.cpp in Sources */,
</span><ins>+                                7C4C96DC1AD4483500365A51 /* ReadableStreamBuiltins.cpp in Sources */,
</ins><span class="cx">                                 7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */,
</span><span class="cx">                                 6C4C96DE1AD4483500365A50 /* JSReadableStreamController.cpp in Sources */,
</span><span class="cx">                                 41189EF91AD8273700B90A0D /* JSReadableStreamControllerCustom.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamCustom.cpp        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -53,12 +53,6 @@
</span><span class="cx">     return state.vm().throwException(&amp;state, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSReadableStream::pipeThrough(ExecState&amp; state)
-{
-    JSValue error = createError(&amp;state, ASCIILiteral(&quot;pipeThrough is not implemented&quot;));
-    return state.vm().throwException(&amp;state, error);
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreJSClientDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> #define WebCoreJSClientData_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWrapperWorld.h&quot;
</span><ins>+#include &quot;ReadableStreamBuiltinsWrapper.h&quot;
</ins><span class="cx"> #include &quot;WebCoreTypedArrayController.h&quot;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -35,7 +36,10 @@
</span><span class="cx">     friend void initNormalWorldClientData(JSC::VM*);
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    WebCoreJSClientData()
</del><ins>+    WebCoreJSClientData(JSC::VM&amp; vm)
+#if ENABLE(STREAMS_API)
+        : m_readableStreamBuiltins(&amp;vm)
+#endif
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -71,14 +75,22 @@
</span><span class="cx">         m_worldSet.remove(&amp;world);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(STREAMS_API)
+    ReadableStreamBuiltinsWrapper&amp; readableStreamBuiltins() { return m_readableStreamBuiltins; }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     HashSet&lt;DOMWrapperWorld*&gt; m_worldSet;
</span><span class="cx">     RefPtr&lt;DOMWrapperWorld&gt; m_normalWorld;
</span><ins>+
+#if ENABLE(STREAMS_API)
+    ReadableStreamBuiltinsWrapper m_readableStreamBuiltins;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline void initNormalWorldClientData(JSC::VM* vm)
</span><span class="cx"> {
</span><del>-    WebCoreJSClientData* webCoreJSClientData = new WebCoreJSClientData;
</del><ins>+    WebCoreJSClientData* webCoreJSClientData = new WebCoreJSClientData(*vm);
</ins><span class="cx">     vm-&gt;clientData = webCoreJSClientData; // ~VM deletes this pointer.
</span><span class="cx">     webCoreJSClientData-&gt;m_normalWorld = DOMWrapperWorld::create(*vm, true);
</span><span class="cx">     vm-&gt;m_typedArrayController = adoptRef(new WebCoreTypedArrayController());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorGObjectpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -379,6 +379,10 @@
</span><span class="cx">         return 1;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;}) {
+        return 1;
+    }
+
</ins><span class="cx">     return 0;
</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 (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -548,6 +548,16 @@
</span><span class="cx"> sub GetFunctionName
</span><span class="cx"> {
</span><span class="cx">     my ($className, $function) = @_;
</span><ins>+
+    my $scopeName = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;};
+    if (!$scopeName) {
+        $scopeName = substr $className, 2;
+    }
+
+    if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;}) {
+        return $codeGenerator-&gt;WK_lcfirst($scopeName) . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name) . &quot;CodeGenerator&quot;;
+    }
+
</ins><span class="cx">     my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : &quot;Prototype&quot;;
</span><span class="cx">     return $codeGenerator-&gt;WK_lcfirst($className) . $kind . &quot;Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
</span><span class="cx"> }
</span><span class="lines">@@ -1731,6 +1741,8 @@
</span><span class="cx">     my $implType = GetImplClassName($interfaceName);
</span><span class="cx">     AddIncludesForTypeInImpl($implType);
</span><span class="cx"> 
</span><ins>+    AddIncludesForJSBuiltinMethods($interface);
+
</ins><span class="cx">     @implContent = ();
</span><span class="cx"> 
</span><span class="cx">     push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
</span><span class="lines">@@ -1747,6 +1759,7 @@
</span><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx">             next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ForwardDeclareInHeader&quot;};
</span><span class="cx">             next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CustomBinding&quot;};
</span><ins>+            next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;};
</ins><span class="cx"> 
</span><span class="cx">             my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
</span><span class="cx">             if ($needsAppleCopyright) {
</span><span class="lines">@@ -1905,12 +1918,7 @@
</span><span class="cx">             my $functionLength = GetFunctionLength($function);
</span><span class="cx">             push(@hashValue2, $functionLength);
</span><span class="cx"> 
</span><del>-            my @specials = ();
-            push(@specials, &quot;DontDelete&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotDeletable&quot;};
-            push(@specials, &quot;DontEnum&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotEnumerable&quot;};
-            push(@specials, &quot;JSC::Function&quot;);
-            my $special = (@specials &gt; 0) ? join(&quot; | &quot;, @specials) : &quot;0&quot;;
-            push(@hashSpecials, $special);
</del><ins>+            push(@hashSpecials, ComputeFunctionSpecial($interface, $function));
</ins><span class="cx"> 
</span><span class="cx">             my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;};
</span><span class="cx">             if ($conditional) {
</span><span class="lines">@@ -1981,14 +1989,7 @@
</span><span class="cx">         my $functionLength = GetFunctionLength($function);
</span><span class="cx">         push(@hashValue2, $functionLength);
</span><span class="cx"> 
</span><del>-        my @specials = ();
-        push(@specials, &quot;DontDelete&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotDeletable&quot;}
-           || $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;}
-           || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
-        push(@specials, &quot;DontEnum&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotEnumerable&quot;};
-        push(@specials, &quot;JSC::Function&quot;);
-        my $special = (@specials &gt; 0) ? join(&quot; | &quot;, @specials) : &quot;0&quot;;
-        push(@hashSpecials, $special);
</del><ins>+        push(@hashSpecials, ComputeFunctionSpecial($interface, $function));
</ins><span class="cx"> 
</span><span class="cx">         my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;};
</span><span class="cx">         if ($conditional) {
</span><span class="lines">@@ -2788,6 +2789,7 @@
</span><span class="cx">         my $inAppleCopyright = 0;
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CustomBinding&quot;};
</span><ins>+            next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;};
</ins><span class="cx">             my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
</span><span class="cx">             if ($needsAppleCopyright) {
</span><span class="cx">                 if (!$inAppleCopyright) {
</span><span class="lines">@@ -4250,6 +4252,8 @@
</span><span class="cx">         
</span><span class="cx">         if (&quot;@$specials[$i]&quot; =~ m/Function/) {
</span><span class="cx">             $firstTargetType = &quot;static_cast&lt;NativeFunction&gt;&quot;;
</span><ins>+        } elsif (&quot;@$specials[$i]&quot; =~ m/Builtin/) {
+            $firstTargetType = &quot;static_cast&lt;BuiltinGenerator&gt;&quot;;
</ins><span class="cx">         } elsif (&quot;@$specials[$i]&quot; =~ m/ConstantInteger/) {
</span><span class="cx">             $firstTargetType = &quot;&quot;;
</span><span class="cx">         } else {
</span><span class="lines">@@ -5002,4 +5006,51 @@
</span><span class="cx">     return IsDOMGlobalObject($interface) || $interface-&gt;extendedAttributes-&gt;{&quot;JSCustomNamedGetterOnPrototype&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;JSCustomDefineOwnPropertyOnPrototype&quot;};
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub ComputeFunctionSpecial
+{
+    my $interface = shift;
+    my $function = shift;
+
+    my @specials = ();
+    push(@specials, &quot;DontDelete&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotDeletable&quot;}
+       || $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;}
+       || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
+    push(@specials, &quot;DontEnum&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NotEnumerable&quot;};
+    if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;}) {
+        push(@specials, &quot;JSC::Builtin&quot;);
+    }
+    else {
+        push(@specials, &quot;JSC::Function&quot;);
+    }
+    return (@specials &gt; 0) ? join(&quot; | &quot;, @specials) : &quot;0&quot;;
+}
+
+sub UseJSBuiltins
+{
+    my $interface = shift;
+    foreach my $function (@{$interface-&gt;functions}) {
+        if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;}) {
+            return 1;
+        }
+    }
+    return 0
+}
+
+sub AddIncludesForJSBuiltinMethods()
+{
+    my $interface = shift;
+
+    foreach my $function (@{$interface-&gt;functions}) {
+        next unless ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSBuiltin&quot;});
+        my $scopeName = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;};
+        if (!$scopeName) {
+            $scopeName = $interface-&gt;name;
+        }
+        AddToImplIncludes($scopeName . &quot;Builtins.h&quot;, $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
+
+        return 1;
+    }
+
+}
+
</ins><span class="cx"> 1;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> InitializedByEventConstructor
</span><span class="cx"> InterfaceName=*
</span><span class="cx"> IsWeakCallback
</span><ins>+JSBuiltin
</ins><span class="cx"> JSCustomDefineOwnProperty
</span><span class="cx"> JSCustomDefineOwnPropertyOnPrototype
</span><span class="cx"> JSCustomFinalize
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;TestNode.h&quot;
</span><span class="cx"> #include &quot;TestObj.h&quot;
</span><ins>+#include &quot;TestObjBuiltins.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &quot;bool.h&quot;
</span><span class="cx"> #include &lt;bindings/ScriptValue.h&gt;
</span><span class="lines">@@ -622,6 +623,8 @@
</span><span class="cx">     { &quot;customMethodWithArgs&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) } },
</span><span class="cx">     { &quot;customBindingMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionCustomBindingMethod), (intptr_t) (0) } },
</span><span class="cx">     { &quot;customBindingMethodWithArgs&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionCustomBindingMethodWithArgs), (intptr_t) (3) } },
</span><ins>+    { &quot;jsBuiltinMethod&quot;, JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast&lt;BuiltinGenerator&gt;(testObjJsBuiltinMethodCodeGenerator), (intptr_t) (0) } },
+    { &quot;jsBuiltinMethodWithArgs&quot;, JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast&lt;BuiltinGenerator&gt;(testObjJsBuiltinMethodWithArgsCodeGenerator), (intptr_t) (3) } },
</ins><span class="cx">     { &quot;addEventListener&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionAddEventListener), (intptr_t) (2) } },
</span><span class="cx">     { &quot;removeEventListener&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t) (2) } },
</span><span class="cx">     { &quot;withScriptStateVoid&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t) (0) } },
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -143,6 +143,8 @@
</span><span class="cx"> - (void)methodWithException;
</span><span class="cx"> - (void)customMethod;
</span><span class="cx"> - (void)customMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</span><ins>+- (void)jsBuiltinMethod;
+- (void)jsBuiltinMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
</ins><span class="cx"> - (void)addEventListener:(NSString *)type listener:(id &lt;DOMEventListener&gt;)listener useCapture:(BOOL)useCapture;
</span><span class="cx"> - (void)removeEventListener:(NSString *)type listener:(id &lt;DOMEventListener&gt;)listener useCapture:(BOOL)useCapture;
</span><span class="cx"> - (void)withScriptStateVoid;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -955,6 +955,18 @@
</span><span class="cx">     IMPL-&gt;customMethodWithArgs(longArg, strArg, core(objArg));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)jsBuiltinMethod
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL-&gt;jsBuiltinMethod();
+}
+
+- (void)jsBuiltinMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL-&gt;jsBuiltinMethodWithArgs(longArg, strArg, core(objArg));
+}
+
</ins><span class="cx"> - (void)addEventListener:(NSString *)type listener:(id &lt;DOMEventListener&gt;)listener useCapture:(BOOL)useCapture
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (190154 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2015-09-23 06:43:44 UTC (rev 190154)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -117,6 +117,10 @@
</span><span class="cx">     [CustomBinding] void customBindingMethod();
</span><span class="cx">     [CustomBinding] void customBindingMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</span><span class="cx"> 
</span><ins>+    // 'JSBuiltin' extended attribute
+    [JSBuiltin] void jsBuiltinMethod();
+    [JSBuiltin] void jsBuiltinMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
+
</ins><span class="cx">     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><span class="cx">     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
</span><span class="cx">     attribute EventHandler onfoo;
</span></span></pre></div>
<a id="trunkSourceWebCoregeneratejsbuiltins"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/generate-js-builtins (0 => 190155)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/generate-js-builtins                                (rev 0)
+++ trunk/Source/WebCore/generate-js-builtins        2015-09-23 07:24:42 UTC (rev 190155)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+#!/usr/bin/python
+# Copyright (C) 2015 Canon Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import argparse
+import filecmp
+import os
+import subprocess
+
+from string import Template
+
+
+parser = argparse.ArgumentParser()
+parser.add_argument('--output_dir', default='', help='output directory')
+parser.add_argument('--input', help='path to input JS file')
+parser.add_argument('--webcore_dir', help='path to WebCore directory')
+
+args = parser.parse_args()
+filename = os.path.splitext(os.path.basename(args.input))[0]
+
+# generate JS builtins
+namespace = &quot;WebCore&quot;
+prefix = &quot;WEBCORE&quot; + filename.upper()
+output = os.path.join(args.output_dir, filename + &quot;Builtins&quot;)
+jsc_generate_builtin_script = os.path.join(args.webcore_dir, &quot;..&quot;, &quot;JavaScriptCore&quot;, &quot;generate-js-builtins&quot;)
+
+subprocess.call([&quot;python&quot;, jsc_generate_builtin_script, &quot;--output&quot;, output, &quot;--namespace&quot;, namespace, &quot;--prefix&quot;, prefix, args.input], stderr=subprocess.STDOUT)
+
+# generate JS builtins wrapper
+output_base = output + &quot;Wrapper&quot;
+
+builtinsWrapperHeader = open(output_base + &quot;.h.tmp&quot;, &quot;w&quot;)
+
+builtinsWrapperHeader.write(Template(
+&quot;&quot;&quot;
+/* Generated by generate-js-builtins do not hand edit. */
+
+/*
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef ${Filename}BuiltinsWrapper_h
+#define ${Filename}BuiltinsWrapper_h
+
+#include &quot;${Filename}Builtins.h&quot;
+#include &lt;bytecode/UnlinkedFunctionExecutable.h&gt;
+#include &lt;builtins/BuiltinUtils.h&gt;
+#include &lt;runtime/Identifier.h&gt;
+
+namespace WebCore {
+
+class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner
+{
+public:
+    explicit ${Filename}BuiltinsWrapper(JSC::VM* vm)
+        : m_vm(*vm)
+        ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
+        ${Prefix}_FOREACH_BUILTIN(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
+    {
+    }
+
+#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \\
+    JSC::UnlinkedFunctionExecutable* name##Executable(); \\
+    const JSC::SourceCode&amp; name##Source() const { return m_##name##Source; }
+    ${Prefix}_FOREACH_BUILTIN(EXPOSE_BUILTIN_EXECUTABLES)
+#undef EXPOSE_BUILTIN_EXECUTABLES
+
+    ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+
+private:
+    JSC::VM&amp; m_vm;
+
+    ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \\
+    JSC::SourceCode m_##name##Source;\\
+    JSC::Weak&lt;JSC::UnlinkedFunctionExecutable&gt; m_##name##Executable;
+    ${Prefix}_FOREACH_BUILTIN(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+
+};
+
+#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \\
+inline JSC::UnlinkedFunctionExecutable* ${Filename}BuiltinsWrapper::name##Executable() \\
+{\\
+    if (!m_##name##Executable)\\
+        m_##name##Executable = JSC::Weak&lt;JSC::UnlinkedFunctionExecutable&gt;(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &amp;m_##name##Executable);\\
+    return m_##name##Executable.get();\\
+}
+${Prefix}_FOREACH_BUILTIN(DEFINE_BUILTIN_EXECUTABLES)
+#undef DEFINE_BUILTIN_EXECUTABLES
+
+} // namespace WebCore
+
+#endif // ${Filename}BuiltinsWrapper_h
+&quot;&quot;&quot;).substitute(dict(Filename=filename, Prefix=prefix)))
+
+builtinsWrapperHeader.close()
+
+if (not os.path.exists(output_base + &quot;.h&quot;)) or (not filecmp.cmp(output_base + &quot;.h.tmp&quot;, output_base + &quot;.h&quot;, shallow=False)):
+    if (os.path.exists(output_base + &quot;.h&quot;)):
+        os.remove(output_base + &quot;.h&quot;)
+    os.rename(output_base + &quot;.h.tmp&quot;, output_base + &quot;.h&quot;)
+else:
+    os.remove(output_base + &quot;.h.tmp&quot;)
</ins></span></pre>
</div>
</div>

</body>
</html>