<!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>[207650] 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/207650">207650</a></dd>
<dt>Author</dt> <dd>jfbastien@apple.com</dd>
<dt>Date</dt> <dd>2016-10-20 18:19:24 -0700 (Thu, 20 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebAssembly API: implement exception constructors properly

 - Rename WebAssemblyObject to JSWebAssembly for consistency.
 - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
   use it to register JSWebAssembly's function properties through auto-generated
   .lut.h, instead of manually.
 - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
 - Register WebAssembly's constructors from the global object, and hold a
   reference to their structure and prototype so that invoking the constructor
   can use the structure directly from the global object.
 - Add a prototype base field to global object creation. Previous ones all had
   Object's prototype as their base, but WebAssembly's error constructors have
   Error as their base.
 - Test for the error object's correctness.
 - Add missing #if ENABLE(WEBASSEMBLY)

WebAssembly API: implement exception constructors properly
https://bugs.webkit.org/show_bug.cgi?id=163699

Reviewed by Keith Miller.

JSTests:

* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties): more tests

Source/JavaScriptCore:

* CMakeLists.txt: rename WebAssemblyObject -&gt; JSWebAssembly; add a .lut.h file
* DerivedSources.make: new .lut.h file
* JavaScriptCore.xcodeproj/project.pbxproj: ditto
* runtime/JSGlobalObject.cpp: new prototypeBase macro
(JSC::JSGlobalObject::init): register WebAssembly constructors here
(JSC::JSGlobalObject::visitChildren): use the macro to visit
* runtime/JSGlobalObject.h: declare the WebAssembly constructor macro
* wasm/JSWebAssembly.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssembly::create):
(JSC::JSWebAssembly::createStructure):
(JSC::JSWebAssembly::finishCreation):
(JSC::JSWebAssembly::JSWebAssembly):
* wasm/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/WebAssemblyObject.cpp: Removed.
* wasm/js/JSWebAssemblyCompileError.cpp:
* wasm/js/JSWebAssemblyCompileError.h:
(JSC::JSWebAssemblyCompileError::create): string convenience
* wasm/js/JSWebAssemblyInstance.cpp:
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyMemory.cpp:
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyRuntimeError.cpp:
* wasm/js/JSWebAssemblyRuntimeError.h:
(JSC::JSWebAssemblyRuntimeError::create): string convenience
* wasm/js/JSWebAssemblyTable.cpp:
* wasm/js/JSWebAssemblyTable.h:
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):don't throw, create the object
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):no need for the structure, it's on the global object
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyCompileErrorPrototype.cpp:
* wasm/js/WebAssemblyCompileErrorPrototype.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyInstancePrototype.cpp:
* wasm/js/WebAssemblyInstancePrototype.h:
* wasm/js/WebAssemblyMemoryConstructor.cpp:
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyMemoryPrototype.cpp:
* wasm/js/WebAssemblyMemoryPrototype.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModulePrototype.cpp:
* wasm/js/WebAssemblyModulePrototype.h:
* wasm/js/WebAssemblyPrototype.cpp: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp.
(JSC::webAssemblyFunctionValidate):
(JSC::webAssemblyFunctionCompile):
(JSC::WebAssemblyPrototype::create):
(JSC::WebAssemblyPrototype::createStructure):
(JSC::WebAssemblyPrototype::finishCreation):
(JSC::WebAssemblyPrototype::WebAssemblyPrototype):
* wasm/js/WebAssemblyPrototype.h: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h.
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):don't throw, create the object
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):no need for the structure, it's on the global object
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorPrototype.cpp:
* wasm/js/WebAssemblyRuntimeErrorPrototype.h:
* wasm/js/WebAssemblyTableConstructor.cpp:
* wasm/js/WebAssemblyTableConstructor.h:
* wasm/js/WebAssemblyTablePrototype.cpp:
* wasm/js/WebAssemblyTablePrototype.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkJSTestswasmjsapitest_basic_apijs">trunk/JSTests/wasm/js-api/test_basic_api.js</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="#trunkSourceJavaScriptCoreDerivedSourcesmake">trunk/Source/JavaScriptCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyCompileErrorcpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyCompileErrorh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstanceh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemorycpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemoryh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyRuntimeErrorcpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyRuntimeErrorh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyTablecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyTableh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorPrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorPrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyInstancePrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyInstancePrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryPrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryPrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModulePrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModulePrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorPrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorPrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTablePrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTablePrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorewasmJSWebAssemblycpp">trunk/Source/JavaScriptCore/wasm/JSWebAssembly.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmJSWebAssemblyh">trunk/Source/JavaScriptCore/wasm/JSWebAssembly.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyPrototypecpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyPrototypeh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorewasmWebAssemblyObjectcpp">trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWebAssemblyObjecth">trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/JSTests/ChangeLog        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-10-20  JF Bastien  &lt;jfbastien@apple.com&gt;
+
+        WebAssembly API: implement exception constructors properly
+
+         - Rename WebAssemblyObject to JSWebAssembly for consistency.
+         - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
+           use it to register JSWebAssembly's function properties through auto-generated
+           .lut.h, instead of manually.
+         - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
+         - Register WebAssembly's constructors from the global object, and hold a
+           reference to their structure and prototype so that invoking the constructor
+           can use the structure directly from the global object.
+         - Add a prototype base field to global object creation. Previous ones all had
+           Object's prototype as their base, but WebAssembly's error constructors have
+           Error as their base.
+         - Test for the error object's correctness.
+         - Add missing #if ENABLE(WEBASSEMBLY)
+
+        WebAssembly API: implement exception constructors properly
+        https://bugs.webkit.org/show_bug.cgi?id=163699
+
+        Reviewed by Keith Miller.
+
+        * wasm/js-api/test_basic_api.js:
+        (const.c.in.constructorProperties): more tests
+
</ins><span class="cx"> 2016-10-20  Caitlin Potter  &lt;caitp@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] disallow references to `await` in AsyncFunction formal parameters
</span></span></pre></div>
<a id="trunkJSTestswasmjsapitest_basic_apijs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/test_basic_api.js (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/test_basic_api.js        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/JSTests/wasm/js-api/test_basic_api.js        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -27,6 +27,9 @@
</span><span class="cx"> checkOwnPropertyDescriptor(utilities.global, &quot;WebAssembly&quot;, { typeofvalue: &quot;object&quot;, writable: true, configurable: true, enumerable: false });
</span><span class="cx"> assert.eq(String(WebAssembly), &quot;[object WebAssembly]&quot;);
</span><span class="cx"> assert.isUndef(WebAssembly.length);
</span><ins>+assert.eq(WebAssembly instanceof Object, true);
+assert.throws(() =&gt; WebAssembly(), TypeError, `WebAssembly is not a function. (In 'WebAssembly()', 'WebAssembly' is an instance of WebAssembly)`);
+assert.throws(() =&gt; new WebAssembly(), TypeError, `WebAssembly is not a constructor (evaluating 'new WebAssembly()')`);
</ins><span class="cx"> 
</span><span class="cx"> for (const f in functionProperties) {
</span><span class="cx">     assert.notUndef(WebAssembly[f]);
</span><span class="lines">@@ -39,10 +42,19 @@
</span><span class="cx">     assert.eq(WebAssembly[c].name, c);
</span><span class="cx">     assert.eq(WebAssembly[c].length, constructorProperties[c].length);
</span><span class="cx">     checkOwnPropertyDescriptor(WebAssembly, c, constructorProperties[c]);
</span><del>-    // Check the constructor's prototype.
</del><span class="cx">     checkOwnPropertyDescriptor(WebAssembly[c], &quot;prototype&quot;, { typeofvalue: &quot;object&quot;, writable: false, configurable: false, enumerable: false });
</span><del>-    assert.eq(String(WebAssembly[c].prototype), `[object WebAssembly.${c}.prototype]`);
</del><span class="cx">     assert.throws(() =&gt; WebAssembly[c](), TypeError, `calling WebAssembly.${c} constructor without new is invalid`);
</span><ins>+    if (constructorProperties[c].isError) {
+        const e = new WebAssembly[c];
+        assert.eq(e instanceof WebAssembly[c], true);
+        assert.eq(e instanceof Error, true);
+        assert.eq(e instanceof TypeError, false);
+        assert.eq(e.message, &quot;&quot;);
+        assert.eq(typeof e.stack, &quot;string&quot;);
+        const sillyString = &quot;uh-oh!&quot;;
+        const e2 = new WebAssembly[c](sillyString);
+        assert.eq(e2.message, sillyString);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME Implement and test these APIs further. For now they just throw. https://bugs.webkit.org/show_bug.cgi?id=159775
</span><span class="lines">@@ -51,5 +63,7 @@
</span><span class="cx">     assert.throws(() =&gt; WebAssembly[f](), Error, `WebAssembly doesn't yet implement the ${f} function property`);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-for (const c in constructorProperties)
-    assert.throws(() =&gt; new WebAssembly[c](), Error, `WebAssembly doesn't yet implement the ${c} constructor property`);
</del><ins>+for (const c in constructorProperties) {
+    if (!constructorProperties[c].isError)
+        assert.throws(() =&gt; new WebAssembly[c](), Error, `WebAssembly doesn't yet implement the ${c} constructor property`);
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -861,12 +861,12 @@
</span><span class="cx">     tools/JSDollarVMPrototype.cpp
</span><span class="cx"> 
</span><span class="cx">     wasm/JSWASMModule.cpp
</span><ins>+    wasm/JSWebAssembly.cpp
</ins><span class="cx">     wasm/WASMB3IRGenerator.cpp
</span><span class="cx">     wasm/WASMCallingConvention.cpp
</span><span class="cx">     wasm/WASMMemory.cpp
</span><span class="cx">     wasm/WASMModuleParser.cpp
</span><span class="cx">     wasm/WASMPlan.cpp
</span><del>-    wasm/WebAssemblyObject.cpp
</del><span class="cx"> 
</span><span class="cx">     wasm/js/JSWebAssemblyCompileError.cpp
</span><span class="cx">     wasm/js/JSWebAssemblyInstance.cpp
</span><span class="lines">@@ -882,6 +882,7 @@
</span><span class="cx">     wasm/js/WebAssemblyMemoryPrototype.cpp
</span><span class="cx">     wasm/js/WebAssemblyModuleConstructor.cpp
</span><span class="cx">     wasm/js/WebAssemblyModulePrototype.cpp
</span><ins>+    wasm/js/WebAssemblyPrototype.cpp
</ins><span class="cx">     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
</span><span class="cx">     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
</span><span class="cx">     wasm/js/WebAssemblyTableConstructor.cpp
</span><span class="lines">@@ -946,6 +947,7 @@
</span><span class="cx">     wasm/js/WebAssemblyMemoryPrototype.cpp
</span><span class="cx">     wasm/js/WebAssemblyModuleConstructor.cpp
</span><span class="cx">     wasm/js/WebAssemblyModulePrototype.cpp
</span><ins>+    wasm/js/WebAssemblyPrototype.cpp
</ins><span class="cx">     wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
</span><span class="cx">     wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
</span><span class="cx">     wasm/js/WebAssemblyTableConstructor.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -1,3 +1,91 @@
</span><ins>+2016-10-20  JF Bastien  &lt;jfbastien@apple.com&gt;
+
+        WebAssembly API: implement exception constructors properly
+
+         - Rename WebAssemblyObject to JSWebAssembly for consistency.
+         - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
+           use it to register JSWebAssembly's function properties through auto-generated
+           .lut.h, instead of manually.
+         - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
+         - Register WebAssembly's constructors from the global object, and hold a
+           reference to their structure and prototype so that invoking the constructor
+           can use the structure directly from the global object.
+         - Add a prototype base field to global object creation. Previous ones all had
+           Object's prototype as their base, but WebAssembly's error constructors have
+           Error as their base.
+         - Test for the error object's correctness.
+         - Add missing #if ENABLE(WEBASSEMBLY)
+
+        WebAssembly API: implement exception constructors properly
+        https://bugs.webkit.org/show_bug.cgi?id=163699
+
+        Reviewed by Keith Miller.
+
+        * CMakeLists.txt: rename WebAssemblyObject -&gt; JSWebAssembly; add a .lut.h file
+        * DerivedSources.make: new .lut.h file
+        * JavaScriptCore.xcodeproj/project.pbxproj: ditto
+        * runtime/JSGlobalObject.cpp: new prototypeBase macro
+        (JSC::JSGlobalObject::init): register WebAssembly constructors here
+        (JSC::JSGlobalObject::visitChildren): use the macro to visit
+        * runtime/JSGlobalObject.h: declare the WebAssembly constructor macro
+        * wasm/JSWebAssembly.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::JSWebAssembly::create):
+        (JSC::JSWebAssembly::createStructure):
+        (JSC::JSWebAssembly::finishCreation):
+        (JSC::JSWebAssembly::JSWebAssembly):
+        * wasm/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/WebAssemblyObject.cpp: Removed.
+        * wasm/js/JSWebAssemblyCompileError.cpp:
+        * wasm/js/JSWebAssemblyCompileError.h:
+        (JSC::JSWebAssemblyCompileError::create): string convenience
+        * wasm/js/JSWebAssemblyInstance.cpp:
+        * wasm/js/JSWebAssemblyInstance.h:
+        * wasm/js/JSWebAssemblyMemory.cpp:
+        * wasm/js/JSWebAssemblyMemory.h:
+        * wasm/js/JSWebAssemblyModule.cpp:
+        * wasm/js/JSWebAssemblyModule.h:
+        * wasm/js/JSWebAssemblyRuntimeError.cpp:
+        * wasm/js/JSWebAssemblyRuntimeError.h:
+        (JSC::JSWebAssemblyRuntimeError::create): string convenience
+        * wasm/js/JSWebAssemblyTable.cpp:
+        * wasm/js/JSWebAssemblyTable.h:
+        * wasm/js/WebAssemblyCompileErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyCompileError):don't throw, create the object
+        (JSC::WebAssemblyCompileErrorConstructor::finishCreation):no need for the structure, it's on the global object
+        * wasm/js/WebAssemblyCompileErrorConstructor.h:
+        * wasm/js/WebAssemblyCompileErrorPrototype.cpp:
+        * wasm/js/WebAssemblyCompileErrorPrototype.h:
+        * wasm/js/WebAssemblyInstanceConstructor.cpp:
+        * wasm/js/WebAssemblyInstanceConstructor.h:
+        * wasm/js/WebAssemblyInstancePrototype.cpp:
+        * wasm/js/WebAssemblyInstancePrototype.h:
+        * wasm/js/WebAssemblyMemoryConstructor.cpp:
+        * wasm/js/WebAssemblyMemoryConstructor.h:
+        * wasm/js/WebAssemblyMemoryPrototype.cpp:
+        * wasm/js/WebAssemblyMemoryPrototype.h:
+        * wasm/js/WebAssemblyModuleConstructor.cpp:
+        * wasm/js/WebAssemblyModuleConstructor.h:
+        * wasm/js/WebAssemblyModulePrototype.cpp:
+        * wasm/js/WebAssemblyModulePrototype.h:
+        * wasm/js/WebAssemblyPrototype.cpp: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp.
+        (JSC::webAssemblyFunctionValidate):
+        (JSC::webAssemblyFunctionCompile):
+        (JSC::WebAssemblyPrototype::create):
+        (JSC::WebAssemblyPrototype::createStructure):
+        (JSC::WebAssemblyPrototype::finishCreation):
+        (JSC::WebAssemblyPrototype::WebAssemblyPrototype):
+        * wasm/js/WebAssemblyPrototype.h: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h.
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyRuntimeError):don't throw, create the object
+        (JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):no need for the structure, it's on the global object
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.h:
+        * wasm/js/WebAssemblyRuntimeErrorPrototype.cpp:
+        * wasm/js/WebAssemblyRuntimeErrorPrototype.h:
+        * wasm/js/WebAssemblyTableConstructor.cpp:
+        * wasm/js/WebAssemblyTableConstructor.h:
+        * wasm/js/WebAssemblyTablePrototype.cpp:
+        * wasm/js/WebAssemblyTablePrototype.h:
+
</ins><span class="cx"> 2016-10-19  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources.make (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources.make        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/DerivedSources.make        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -168,6 +168,7 @@
</span><span class="cx">     WebAssemblyMemoryPrototype.lut.h \
</span><span class="cx">     WebAssemblyModuleConstructor.lut.h \
</span><span class="cx">     WebAssemblyModulePrototype.lut.h \
</span><ins>+    WebAssemblyPrototype.lut.h \
</ins><span class="cx">     WebAssemblyRuntimeErrorConstructor.lut.h \
</span><span class="cx">     WebAssemblyRuntimeErrorPrototype.lut.h \
</span><span class="cx">     WebAssemblyTableConstructor.lut.h \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -1879,8 +1879,6 @@
</span><span class="cx">                 A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7FCC26D17A0B6AA00786D1A /* FTLSwitchCase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FCC26C17A0B6AA00786D1A /* FTLSwitchCase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A8A4748E151A8306004123FF /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; };
</span><del>-                AD2FCB881DAEBF3C00B3E736 /* WebAssemblyObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */; };
-                AD2FCB891DAEBF3F00B3E736 /* WebAssemblyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */; };
</del><span class="cx">                 AD2FCBE21DB58DAD00B3E736 /* JSWebAssemblyCompileError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */; };
</span><span class="cx">                 AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */; };
</span><span class="cx">                 AD2FCBE41DB58DAD00B3E736 /* JSWebAssemblyInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */; };
</span><span class="lines">@@ -1929,6 +1927,10 @@
</span><span class="cx">                 AD2FCC1F1DB59CB200B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC131DB59C5900B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h */; };
</span><span class="cx">                 AD2FCC201DB59CB200B3E736 /* WebAssemblyTableConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC141DB59C5900B3E736 /* WebAssemblyTableConstructor.lut.h */; };
</span><span class="cx">                 AD2FCC211DB59CB200B3E736 /* WebAssemblyTablePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */; };
</span><ins>+                AD2FCC2C1DB838FD00B3E736 /* WebAssemblyPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCC261DB838C400B3E736 /* WebAssemblyPrototype.cpp */; };
+                AD2FCC2D1DB838FD00B3E736 /* WebAssemblyPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC271DB838C400B3E736 /* WebAssemblyPrototype.h */; };
+                AD2FCC301DB83D4900B3E736 /* JSWebAssembly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCC2E1DB839F700B3E736 /* JSWebAssembly.cpp */; };
+                AD2FCC311DB83D4900B3E736 /* JSWebAssembly.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC2F1DB839F700B3E736 /* JSWebAssembly.h */; };
</ins><span class="cx">                 AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 ADDB1F6318D77DBE009B58A8 /* OpaqueRootSet.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; };
</span><span class="lines">@@ -4259,8 +4261,6 @@
</span><span class="cx">                 A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyTable.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAssemblyObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 AD2FCB8C1DB5844000B3E736 /* JSWebAssemblyModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyModule.cpp; path = js/JSWebAssemblyModule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD2FCB8D1DB5844000B3E736 /* JSWebAssemblyModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyModule.h; path = js/JSWebAssemblyModule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD2FCB981DB585A600B3E736 /* WebAssemblyModuleConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyModuleConstructor.cpp; path = js/WebAssemblyModuleConstructor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4309,6 +4309,10 @@
</span><span class="cx">                 AD2FCC131DB59C5900B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyRuntimeErrorPrototype.lut.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD2FCC141DB59C5900B3E736 /* WebAssemblyTableConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyTableConstructor.lut.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyTablePrototype.lut.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                AD2FCC261DB838C400B3E736 /* WebAssemblyPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyPrototype.cpp; path = js/WebAssemblyPrototype.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                AD2FCC271DB838C400B3E736 /* WebAssemblyPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyPrototype.h; path = js/WebAssemblyPrototype.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                AD2FCC2E1DB839F700B3E736 /* JSWebAssembly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebAssembly.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                AD2FCC2F1DB839F700B3E736 /* JSWebAssembly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebAssembly.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMapInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueRootSet.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59F89371891AD3300D5CCDC /* UnlinkedInstructionStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedInstructionStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5803,9 +5807,9 @@
</span><span class="cx">                 7B98D1331B60CD1E0023B1A4 /* wasm */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                AD2FCC2E1DB839F700B3E736 /* JSWebAssembly.cpp */,
+                                AD2FCC2F1DB839F700B3E736 /* JSWebAssembly.h */,
</ins><span class="cx">                                 AD2FCB8A1DB5840000B3E736 /* js */,
</span><del>-                                AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */,
-                                AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */,
</del><span class="cx">                                 7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */,
</span><span class="cx">                                 7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */,
</span><span class="cx">                                 53F40E8E1D5902820099A1B6 /* WASMB3IRGenerator.cpp */,
</span><span class="lines">@@ -7312,6 +7316,8 @@
</span><span class="cx">                 AD2FCB8A1DB5840000B3E736 /* js */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                AD2FCC261DB838C400B3E736 /* WebAssemblyPrototype.cpp */,
+                                AD2FCC271DB838C400B3E736 /* WebAssemblyPrototype.h */,
</ins><span class="cx">                                 AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */,
</span><span class="cx">                                 AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */,
</span><span class="cx">                                 AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */,
</span><span class="lines">@@ -7615,7 +7621,6 @@
</span><span class="cx">                                 0FC97F34182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.h in Headers */,
</span><span class="cx">                                 0FD8A31417D4326C00CA2C40 /* CodeBlockSet.h in Headers */,
</span><span class="cx">                                 0F96EBB316676EF6008BADE3 /* CodeBlockWithJITType.h in Headers */,
</span><del>-                                AD2FCB891DAEBF3F00B3E736 /* WebAssemblyObject.h in Headers */,
</del><span class="cx">                                 A77F1822164088B200640A47 /* CodeCache.h in Headers */,
</span><span class="cx">                                 99CC0B6318BE9950006CEBCC /* CodeGeneratorReplayInputs.py in Headers */,
</span><span class="cx">                                 99CC0B6218BE9946006CEBCC /* CodeGeneratorReplayInputsTemplates.py in Headers */,
</span><span class="lines">@@ -7739,6 +7744,7 @@
</span><span class="cx">                                 A7D89CF617A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.h in Headers */,
</span><span class="cx">                                 0FFFC95A14EF90A900C72532 /* DFGCSEPhase.h in Headers */,
</span><span class="cx">                                 0F2FC77316E12F740038D976 /* DFGDCEPhase.h in Headers */,
</span><ins>+                                AD2FCC311DB83D4900B3E736 /* JSWebAssembly.h in Headers */,
</ins><span class="cx">                                 0F8F2B9A172F0501007DBDA5 /* DFGDesiredIdentifiers.h in Headers */,
</span><span class="cx">                                 8B9F6D561D5912FA001C739F /* IterationKind.h in Headers */,
</span><span class="cx">                                 0FFC92141B94E83E0071DD66 /* DFGDesiredInferredType.h in Headers */,
</span><span class="lines">@@ -8510,6 +8516,7 @@
</span><span class="cx">                                 A5BA15EA182340B400A82E69 /* RemoteInspectorConstants.h in Headers */,
</span><span class="cx">                                 A5BA15F0182345AF00A82E69 /* RemoteInspectionTarget.h in Headers */,
</span><span class="cx">                                 A5BA15EB182340B400A82E69 /* RemoteConnectionToTarget.h in Headers */,
</span><ins>+                                AD2FCC2D1DB838FD00B3E736 /* WebAssemblyPrototype.h in Headers */,
</ins><span class="cx">                                 A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */,
</span><span class="cx">                                 0F24E55117EE274900ABB217 /* Repatch.h in Headers */,
</span><span class="cx">                                 DC2143071CA32E55000A8869 /* ICStats.h in Headers */,
</span><span class="lines">@@ -9450,6 +9457,7 @@
</span><span class="cx">                                 0F8F14351ADF090100ED792C /* DFGMovHintRemovalPhase.cpp in Sources */,
</span><span class="cx">                                 0FF2CD5B1B61A4F8004955A8 /* DFGMultiGetByOffsetData.cpp in Sources */,
</span><span class="cx">                                 A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */,
</span><ins>+                                AD2FCC301DB83D4900B3E736 /* JSWebAssembly.cpp in Sources */,
</ins><span class="cx">                                 79B00CBE1C6AB07E0088C65D /* ProxyObject.cpp in Sources */,
</span><span class="cx">                                 792CB3491C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp in Sources */,
</span><span class="cx">                                 0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
</span><span class="lines">@@ -9717,6 +9725,7 @@
</span><span class="cx">                                 147F39D6107EC37600427A48 /* JSCJSValue.cpp in Sources */,
</span><span class="cx">                                 1440FCE40A51E46B0005F061 /* JSClassRef.cpp in Sources */,
</span><span class="cx">                                 86E3C616167BABEE006D760A /* JSContext.mm in Sources */,
</span><ins>+                                AD2FCC2C1DB838FD00B3E736 /* WebAssemblyPrototype.cpp in Sources */,
</ins><span class="cx">                                 14BD5A300A3E91F600BAF59C /* JSContextRef.cpp in Sources */,
</span><span class="cx">                                 A72028B61797601E0098028C /* JSCTestRunnerUtils.cpp in Sources */,
</span><span class="cx">                                 0F2B66EB17B6B5AB00A7AE3F /* JSDataView.cpp in Sources */,
</span><span class="lines">@@ -9938,7 +9947,6 @@
</span><span class="cx">                                 7905BB681D12050E0019FE57 /* InlineAccess.cpp in Sources */,
</span><span class="cx">                                 0FE050271AA9095600D33B33 /* ScopedArguments.cpp in Sources */,
</span><span class="cx">                                 0FE0502F1AAA806900D33B33 /* ScopedArgumentsTable.cpp in Sources */,
</span><del>-                                AD2FCB881DAEBF3C00B3E736 /* WebAssemblyObject.cpp in Sources */,
</del><span class="cx">                                 992ABCF91BEA9BD2006403A0 /* RemoteAutomationTarget.cpp in Sources */,
</span><span class="cx">                                 0FE0502A1AA9095600D33B33 /* ScopeOffset.cpp in Sources */,
</span><span class="cx">                                 0FA7A8EE18CE4FD80052371D /* ScratchRegisterAllocator.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> #include &quot;JSTypedArrays.h&quot;
</span><span class="cx"> #include &quot;JSWeakMap.h&quot;
</span><span class="cx"> #include &quot;JSWeakSet.h&quot;
</span><ins>+#include &quot;JSWebAssembly.h&quot;
</ins><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LazyClassStructureInlines.h&quot;
</span><span class="cx"> #include &quot;LazyPropertyInlines.h&quot;
</span><span class="lines">@@ -154,7 +155,6 @@
</span><span class="cx"> #include &quot;WeakMapPrototype.h&quot;
</span><span class="cx"> #include &quot;WeakSetConstructor.h&quot;
</span><span class="cx"> #include &quot;WeakSetPrototype.h&quot;
</span><del>-#include &quot;WebAssemblyObject.h&quot;
</del><span class="cx"> #include &lt;wtf/RandomNumber.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INTL)
</span><span class="lines">@@ -541,8 +541,8 @@
</span><span class="cx">     m_parseIntFunction.set(vm, this, JSFunction::create(vm, this, 2, vm.propertyNames-&gt;parseInt.string(), globalFuncParseInt, NoIntrinsic));
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;parseInt, m_parseIntFunction.get(), DontEnum);
</span><span class="cx"> 
</span><del>-#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
-m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \
</del><ins>+#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
+m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_ ## prototypeBase ## Prototype.get()))); \
</ins><span class="cx"> m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get()));
</span><span class="cx">     
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE)
</span><span class="lines">@@ -549,10 +549,10 @@
</span><span class="cx">     
</span><span class="cx"> #undef CREATE_PROTOTYPE_FOR_SIMPLE_TYPE
</span><span class="cx"> 
</span><del>-#define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     m_ ## properName ## Structure.initLater(\
</span><span class="cx">         [] (LazyClassStructure::Initializer&amp; init) { \
</span><del>-            init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global-&gt;m_objectPrototype.get()))); \
</del><ins>+            init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global-&gt;m_ ## prototypeBase ## Prototype.get()))); \
</ins><span class="cx">             init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \
</span><span class="cx">             init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global-&gt;m_functionPrototype.get()), jsCast&lt;capitalName ## Prototype*&gt;(init.prototype), init.global-&gt;m_speciesGetterSetter.get())); \
</span><span class="cx">         });
</span><span class="lines">@@ -563,7 +563,7 @@
</span><span class="cx">     
</span><span class="cx">     m_iteratorPrototype.set(vm, this, IteratorPrototype::create(vm, this, IteratorPrototype::createStructure(vm, this, m_objectPrototype.get())));
</span><span class="cx"> 
</span><del>-#define CREATE_PROTOTYPE_FOR_DERIVED_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define CREATE_PROTOTYPE_FOR_DERIVED_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     m_ ## lowerName ## Structure.initLater( \
</span><span class="cx">         [] (const Initializer&lt;Structure&gt;&amp; init) { \
</span><span class="cx">             JSObject* prototype = capitalName ## Prototype::create(init.vm, init.owner, capitalName ## Prototype::createStructure(init.vm, init.owner, init.owner-&gt;m_iteratorPrototype.get())); \
</span><span class="lines">@@ -590,7 +590,7 @@
</span><span class="cx">     
</span><span class="cx">     m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get(), m_speciesGetterSetter.get()));
</span><span class="cx">     
</span><del>-#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx"> capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()); \
</span><span class="cx"> m_ ## lowerName ## Prototype-&gt;putDirectWithoutTransition(vm, vm.propertyNames-&gt;constructor, lowerName ## Constructor, DontEnum); \
</span><span class="cx"> 
</span><span class="lines">@@ -646,7 +646,7 @@
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;builtinNames().ObjectPrivateName(), objectConstructor, DontEnum | DontDelete | ReadOnly);
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;builtinNames().ArrayPrivateName(), arrayConstructor, DontEnum | DontDelete | ReadOnly);
</span><span class="cx"> 
</span><del>-#define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx"> putDirectWithoutTransition(vm, vm.propertyNames-&gt; jsName, lowerName ## Constructor, DontEnum); \
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE)
</span><span class="lines">@@ -820,14 +820,28 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">     if (Options::useWebAssembly()) {
</span><del>-        auto* wasm = WebAssemblyObject::create(vm, this, WebAssemblyObject::createStructure(vm, this, m_objectPrototype.get()));
-        putDirectWithoutTransition(vm, Identifier::fromString(exec, &quot;WebAssembly&quot;), wasm, DontEnum);
-        GlobalPropertyInfo extraStaticGlobals[] = {
-#define REGISTER_WASM_CONSTRUCTOR_AS_GLOBAL_PROPERTY(NAME, ...) \
-            GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().NAME ## PrivateName(), wasm-&gt;getDirect(vm, Identifier::fromString(exec, #NAME)), DontEnum | DontDelete | ReadOnly),
-            FOR_EACH_WASM_CONSTRUCTOR_PROPERTY(REGISTER_WASM_CONSTRUCTOR_AS_GLOBAL_PROPERTY)
-        };
-        addStaticGlobals(extraStaticGlobals, WTF_ARRAY_LENGTH(extraStaticGlobals));
</del><ins>+        auto* webAssemblyPrototype = WebAssemblyPrototype::create(vm, this, WebAssemblyPrototype::createStructure(vm, this, m_objectPrototype.get()));
+        m_webAssemblyStructure.set(vm, this, JSWebAssembly::createStructure(vm, this, webAssemblyPrototype));
+        auto* webAssembly = JSWebAssembly::create(vm, this, m_webAssemblyStructure.get());
+        putDirectWithoutTransition(vm, Identifier::fromString(exec, &quot;WebAssembly&quot;), webAssembly, DontEnum);
+
+#define CREATE_WEBASSEMBLY_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \
+        typedef capitalName ## Prototype Prototype; \
+        typedef capitalName ## Constructor Constructor; \
+        typedef JS ## capitalName JSObj; \
+        auto* base = m_ ## prototypeBase ## Prototype.get(); \
+        auto* prototype = Prototype::create(vm, this, Prototype::createStructure(vm, this, base)); \
+        auto* structure = JSObj::createStructure(vm, this, prototype); \
+        auto* constructor = Constructor::create(vm, Constructor::createStructure(vm, this, this-&gt;functionPrototype()), prototype, structure); \
+        prototype-&gt;putDirectWithoutTransition(vm, vm.propertyNames-&gt;constructor, constructor, DontEnum); \
+        m_ ## lowerName ## Prototype.set(vm, this, prototype); \
+        m_ ## properName ## Structure.set(vm, this, structure); \
+        webAssembly-&gt;putDirectWithoutTransition(vm, Identifier::fromString(this-&gt;globalExec(), #jsName), constructor, DontEnum); \
+    } while (0);
+
+        FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_CONSTRUCTOR)
+
+#undef CREATE_WEBASSEMBLY_CONSTRUCTOR
</ins><span class="cx">     }
</span><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><span class="lines">@@ -1142,15 +1156,20 @@
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_proxyRevokeStructure);
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_moduleLoaderStructure);
</span><span class="cx"> 
</span><del>-#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     visitor.append(&amp;thisObject-&gt;m_ ## lowerName ## Prototype); \
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_ ## properName ## Structure); \
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE)
</span><ins>+    
+#if ENABLE(WEBASSEMBLY)
+    visitor.append(&amp;thisObject-&gt;m_webAssemblyStructure);
+    FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(VISIT_SIMPLE_TYPE)
+#endif // ENABLE(WEBASSEMBLY)
</ins><span class="cx"> 
</span><span class="cx"> #undef VISIT_SIMPLE_TYPE
</span><span class="cx"> 
</span><del>-#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     thisObject-&gt;m_ ## properName ## Structure.visit(visitor);
</span><span class="cx">     
</span><span class="cx">     FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -95,16 +95,16 @@
</span><span class="cx"> struct ActivationStackNode;
</span><span class="cx"> struct HashTable;
</span><span class="cx"> 
</span><del>-#define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName)
</del><ins>+#define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName, object)
</ins><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \
</span><del>-    macro(String, string, stringObject, StringObject, String) \
-    macro(Symbol, symbol, symbolObject, SymbolObject, Symbol) \
-    macro(Number, number, numberObject, NumberObject, Number) \
-    macro(Error, error, error, ErrorInstance, Error) \
-    macro(Map, map, map, JSMap, Map) \
-    macro(JSPromise, promise, promise, JSPromise, Promise) \
-    macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer) \
</del><ins>+    macro(String, string, stringObject, StringObject, String, object) \
+    macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \
+    macro(Number, number, numberObject, NumberObject, Number, object) \
+    macro(Error, error, error, ErrorInstance, Error, object) \
+    macro(Map, map, map, JSMap, Map, object) \
+    macro(JSPromise, promise, promise, JSPromise, Promise, object) \
+    macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer, object) \
</ins><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(macro) \
</span><span class="cx">     DEFINE_STANDARD_BUILTIN(macro, MapIterator, mapIterator) \
</span><span class="lines">@@ -117,16 +117,28 @@
</span><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_SIMPLE_BUILTIN_TYPE(macro) \
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \
</span><del>-    macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise) \
</del><ins>+    macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object) \
</ins><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_LAZY_BUILTIN_TYPE(macro) \
</span><del>-    macro(Set, set, set, JSSet, Set) \
-    macro(Date, date, date, DateInstance, Date) \
-    macro(Boolean, boolean, booleanObject, BooleanObject, Boolean) \
</del><ins>+    macro(Set, set, set, JSSet, Set, object) \
+    macro(Date, date, date, DateInstance, Date, object) \
+    macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \
</ins><span class="cx">     DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \
</span><span class="cx">     DEFINE_STANDARD_BUILTIN(macro, WeakSet, weakSet) \
</span><span class="cx"> 
</span><del>-#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#if ENABLE(WEBASSEMBLY)
+#define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \
+    macro(WebAssemblyCompileError, webAssemblyCompileError, WebAssemblyCompileError, WebAssemblyCompileError, CompileError, error) \
+    macro(WebAssemblyInstance,     webAssemblyInstance,     WebAssemblyInstance,     WebAssemblyInstance,     Instance,     object) \
+    macro(WebAssemblyMemory,       webAssemblyMemory,       WebAssemblyMemory,       WebAssemblyMemory,       Memory,       object) \
+    macro(WebAssemblyModule,       webAssemblyModule,       WebAssemblyModule,       WebAssemblyModule,       Module,       object) \
+    macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, WebAssemblyRuntimeError, WebAssemblyRuntimeError, RuntimeError, error) \
+    macro(WebAssemblyTable,        webAssemblyTable,        WebAssemblyTable,        WebAssemblyTable,        Table,        object)
+#else
+#define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro)
+#endif // ENABLE(WEBASSEMBLY)
+
+#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     class JS ## capitalName; \
</span><span class="cx">     class capitalName ## Prototype; \
</span><span class="cx">     class capitalName ## Constructor;
</span><span class="lines">@@ -135,6 +147,7 @@
</span><span class="cx"> FOR_EACH_SIMPLE_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE)
</span><span class="cx"> FOR_EACH_LAZY_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE)
</span><span class="cx"> FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE)
</span><ins>+FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE)
</ins><span class="cx"> 
</span><span class="cx"> #undef DECLARE_SIMPLE_BUILTIN_TYPE
</span><span class="cx"> 
</span><span class="lines">@@ -305,20 +318,25 @@
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_proxyRevokeStructure;
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_moduleLoaderStructure;
</span><span class="cx"> 
</span><del>-#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     WriteBarrier&lt;capitalName ## Prototype&gt; m_ ## lowerName ## Prototype; \
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_ ## properName ## Structure;
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
</span><ins>+    
+#if ENABLE(WEBASSEMBLY)
+    WriteBarrier&lt;Structure&gt; m_webAssemblyStructure;
+    FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
+#endif // ENABLE(WEBASSEMBLY)
</ins><span class="cx"> 
</span><span class="cx"> #undef DEFINE_STORAGE_FOR_SIMPLE_TYPE
</span><span class="cx"> 
</span><del>-#define DEFINE_STORAGE_FOR_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_STORAGE_FOR_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     LazyProperty&lt;JSGlobalObject, Structure&gt; m_ ## properName ## Structure;
</span><span class="cx">     FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_STORAGE_FOR_ITERATOR_TYPE)
</span><span class="cx"> #undef DEFINE_STORAGE_FOR_ITERATOR_TYPE
</span><span class="cx">     
</span><del>-#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     LazyClassStructure m_ ## properName ## Structure;
</span><span class="cx">     FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
</span><span class="cx"> #undef DEFINE_STORAGE_FOR_LAZY_TYPE
</span><span class="lines">@@ -606,14 +624,15 @@
</span><span class="cx"> 
</span><span class="cx">     JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); }
</span><span class="cx"> 
</span><del>-#define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     Structure* properName ## Structure() { return m_ ## properName ## Structure.get(); }
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</span><ins>+    FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</ins><span class="cx"> 
</span><span class="cx"> #undef DEFINE_ACCESSORS_FOR_SIMPLE_TYPE
</span><span class="cx"> 
</span><del>-#define DEFINE_ACCESSORS_FOR_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_ACCESSORS_FOR_ITERATOR_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); }
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_ACCESSORS_FOR_ITERATOR_TYPE)
</span><span class="lines">@@ -620,7 +639,7 @@
</span><span class="cx"> 
</span><span class="cx"> #undef DEFINE_ACCESSORS_FOR_ITERATOR_TYPE
</span><span class="cx"> 
</span><del>-#define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</del><ins>+#define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</ins><span class="cx">     Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); }
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_LAZY_TYPE)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmJSWebAssemblycppfromrev207649trunkSourceJavaScriptCorewasmjsWebAssemblyTablePrototypecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/wasm/JSWebAssembly.cpp (from rev 207649, trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp) (0 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/JSWebAssembly.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/wasm/JSWebAssembly.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSWebAssembly.h&quot;
+
+#if ENABLE(WEBASSEMBLY)
+
+#include &quot;FunctionPrototype.h&quot;
+#include &quot;JSCInlines.h&quot;
+
+namespace JSC {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSWebAssembly);
+
+const ClassInfo JSWebAssembly::s_info = { &quot;WebAssembly&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssembly) };
+
+JSWebAssembly* JSWebAssembly::create(VM&amp; vm, JSGlobalObject* globalObject, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell&lt;JSWebAssembly&gt;(vm.heap)) JSWebAssembly(vm, structure);
+    object-&gt;finishCreation(vm, globalObject);
+    return object;
+}
+
+Structure* JSWebAssembly::createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void JSWebAssembly::finishCreation(VM&amp; vm, JSGlobalObject*)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+JSWebAssembly::JSWebAssembly(VM&amp; vm, Structure* structure)
+    : JSNonFinalObject(vm, structure)
+{
+}
+
+} // namespace JSC
+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmJSWebAssemblyhfromrev207649trunkSourceJavaScriptCorewasmWebAssemblyObjecth"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/wasm/JSWebAssembly.h (from rev 207649, trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.h) (0 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/JSWebAssembly.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/wasm/JSWebAssembly.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBASSEMBLY)
+
+#include &quot;JSObject.h&quot;
+#include &quot;js/JSWebAssemblyCompileError.h&quot;
+#include &quot;js/JSWebAssemblyInstance.h&quot;
+#include &quot;js/JSWebAssemblyMemory.h&quot;
+#include &quot;js/JSWebAssemblyModule.h&quot;
+#include &quot;js/JSWebAssemblyRuntimeError.h&quot;
+#include &quot;js/JSWebAssemblyTable.h&quot;
+#include &quot;js/WebAssemblyCompileErrorConstructor.h&quot;
+#include &quot;js/WebAssemblyCompileErrorPrototype.h&quot;
+#include &quot;js/WebAssemblyInstanceConstructor.h&quot;
+#include &quot;js/WebAssemblyInstancePrototype.h&quot;
+#include &quot;js/WebAssemblyMemoryConstructor.h&quot;
+#include &quot;js/WebAssemblyMemoryPrototype.h&quot;
+#include &quot;js/WebAssemblyModuleConstructor.h&quot;
+#include &quot;js/WebAssemblyModulePrototype.h&quot;
+#include &quot;js/WebAssemblyPrototype.h&quot;
+#include &quot;js/WebAssemblyRuntimeErrorConstructor.h&quot;
+#include &quot;js/WebAssemblyRuntimeErrorPrototype.h&quot;
+#include &quot;js/WebAssemblyTableConstructor.h&quot;
+#include &quot;js/WebAssemblyTablePrototype.h&quot;
+
+namespace JSC {
+
+class JSWebAssembly : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+
+    static JSWebAssembly* create(VM&amp;, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&amp;, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&amp;, JSGlobalObject*);
+
+private:
+    JSWebAssembly(VM&amp;, Structure*);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWebAssemblyObjectcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -1,113 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WebAssemblyObject.h&quot;
-
-#include &quot;FunctionPrototype.h&quot;
-#include &quot;JSCInlines.h&quot;
-#include &quot;js/JSWebAssemblyCompileError.h&quot;
-#include &quot;js/JSWebAssemblyInstance.h&quot;
-#include &quot;js/JSWebAssemblyMemory.h&quot;
-#include &quot;js/JSWebAssemblyModule.h&quot;
-#include &quot;js/JSWebAssemblyRuntimeError.h&quot;
-#include &quot;js/JSWebAssemblyTable.h&quot;
-#include &quot;js/WebAssemblyCompileErrorConstructor.h&quot;
-#include &quot;js/WebAssemblyCompileErrorPrototype.h&quot;
-#include &quot;js/WebAssemblyInstanceConstructor.h&quot;
-#include &quot;js/WebAssemblyInstancePrototype.h&quot;
-#include &quot;js/WebAssemblyMemoryConstructor.h&quot;
-#include &quot;js/WebAssemblyMemoryPrototype.h&quot;
-#include &quot;js/WebAssemblyModuleConstructor.h&quot;
-#include &quot;js/WebAssemblyModulePrototype.h&quot;
-#include &quot;js/WebAssemblyRuntimeErrorConstructor.h&quot;
-#include &quot;js/WebAssemblyRuntimeErrorPrototype.h&quot;
-#include &quot;js/WebAssemblyTableConstructor.h&quot;
-#include &quot;js/WebAssemblyTablePrototype.h&quot;
-
-namespace JSC {
-
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(WebAssemblyObject);
-
-#define DECLARE_WASM_OBJECT_FUNCTION(NAME, ...) EncodedJSValue JSC_HOST_CALL wasmObjectFunc ## NAME(ExecState*);
-FOR_EACH_WASM_FUNCTION_PROPERTY(DECLARE_WASM_OBJECT_FUNCTION)
-
-const ClassInfo WebAssemblyObject::s_info = { &quot;WebAssembly&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(WebAssemblyObject) };
-
-WebAssemblyObject* WebAssemblyObject::create(VM&amp; vm, JSGlobalObject* globalObject, Structure* structure)
-{
-    auto* object = new (NotNull, allocateCell&lt;WebAssemblyObject&gt;(vm.heap)) WebAssemblyObject(vm, structure);
-    object-&gt;finishCreation(vm, globalObject);
-    return object;
-}
-
-Structure* WebAssemblyObject::createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
-{
-    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
-}
-
-void WebAssemblyObject::finishCreation(VM&amp; vm, JSGlobalObject* globalObject)
-{
-    Base::finishCreation(vm);
-    ASSERT(inherits(info()));
-
-#define SET_UP_WASM_CONSTRUCTOR_PROPERTY(NAME, ...) \
-    auto* prototype ## NAME = WebAssembly ## NAME ## Prototype::create(vm, globalObject, WebAssembly ## NAME ## Prototype::createStructure(vm, globalObject, globalObject-&gt;objectPrototype())); \
-    auto* structure ## NAME = JSWebAssembly ## NAME::createStructure(vm, globalObject, prototype ## NAME); \
-    auto* constructor ## NAME = WebAssembly ## NAME ## Constructor::create(vm, WebAssembly ## NAME ## Constructor::createStructure(vm, globalObject, globalObject-&gt;functionPrototype()), prototype ## NAME, structure ## NAME); \
-    prototype ## NAME-&gt;putDirectWithoutTransition(vm, vm.propertyNames-&gt;constructor, constructor ## NAME, DontEnum);
-    FOR_EACH_WASM_CONSTRUCTOR_PROPERTY(SET_UP_WASM_CONSTRUCTOR_PROPERTY)
-
-#define REGISTER_WASM_CONSTRUCTOR_PROPERTY(NAME, ...) \
-    putDirectWithoutTransition(vm, Identifier::fromString(globalObject-&gt;globalExec(), #NAME), constructor ## NAME, DontEnum);
-    FOR_EACH_WASM_CONSTRUCTOR_PROPERTY(REGISTER_WASM_CONSTRUCTOR_PROPERTY)
-
-#define REGISTER_WASM_FUNCTION_PROPERTY(NAME, LENGTH) \
-    putDirectNativeFunction(vm, globalObject, Identifier::fromString(&amp;vm, #NAME), LENGTH, wasmObjectFunc ## NAME, NoIntrinsic, DontEnum);
-    FOR_EACH_WASM_FUNCTION_PROPERTY(REGISTER_WASM_FUNCTION_PROPERTY)
-}
-
-WebAssemblyObject::WebAssemblyObject(VM&amp; vm, Structure* structure)
-    : JSNonFinalObject(vm, structure)
-{
-}
-
-// ------------------------------ Functions --------------------------------
-
-EncodedJSValue JSC_HOST_CALL wasmObjectFuncvalidate(ExecState* state)
-{
-    VM&amp; vm = state-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the validate function property&quot;))));
-}
-
-EncodedJSValue JSC_HOST_CALL wasmObjectFunccompile(ExecState* state)
-{
-    VM&amp; vm = state-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the compile function property&quot;))));
-}
-
-} // namespace JSC
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWebAssemblyObjecth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/WebAssemblyObject.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include &quot;JSObject.h&quot;
-
-namespace JSC {
-
-class WebAssemblyObject : public JSNonFinalObject {
-public:
-    typedef JSNonFinalObject Base;
-
-    static WebAssemblyObject* create(VM&amp;, JSGlobalObject*, Structure*);
-    static Structure* createStructure(VM&amp;, JSGlobalObject*, JSValue);
-
-    DECLARE_INFO;
-
-protected:
-    void finishCreation(VM&amp;, JSGlobalObject*);
-
-private:
-    WebAssemblyObject(VM&amp;, Structure*);
-};
-
-// Name, functionLength
-#define FOR_EACH_WASM_CONSTRUCTOR_PROPERTY(DO) \
-    DO(Module, 1) \
-    DO(Instance, 2) \
-    DO(Memory, 1) \
-    DO(Table, 1) \
-    DO(CompileError, 1) \
-    DO(RuntimeError, 1)
-
-// Name, functionLength
-#define FOR_EACH_WASM_FUNCTION_PROPERTY(DO) \
-    DO(validate, 1) \
-    DO(compile, 1)
-
-} // namespace JSC
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyCompileErrorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyCompileError.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -46,3 +48,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyCompileError::s_info = { &quot;WebAssembly.CompileError&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyCompileError) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyCompileErrorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;ErrorInstance.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -34,6 +36,10 @@
</span><span class="cx">     typedef ErrorInstance Base;
</span><span class="cx"> 
</span><span class="cx">     static JSWebAssemblyCompileError* create(ExecState*, Structure*, const String&amp;, bool);
</span><ins>+    static JSWebAssemblyCompileError* create(ExecState* exec, Structure* structure, JSValue message, bool useCurrentFrame)
+    {
+        return create(exec, structure, message.isUndefined() ? String() : message.toString(exec)-&gt;value(exec), useCurrentFrame);
+    }
</ins><span class="cx"> 
</span><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><span class="lines">@@ -42,3 +48,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyInstance.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -69,3 +71,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyInstance::s_info = { &quot;WebAssembly.Instance&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyInstance) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -47,3 +49,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyMemory.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -69,3 +71,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyMemory::s_info = { &quot;WebAssembly.Memory&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyMemory) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -47,3 +49,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyModule.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -69,3 +71,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyModule::s_info = { &quot;WebAssembly.Module&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyModule) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -47,3 +49,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyRuntimeErrorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyRuntimeError.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -46,3 +48,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyRuntimeError::s_info = { &quot;WebAssembly.RuntimeError&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyRuntimeError) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyRuntimeErrorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;ErrorInstance.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -34,6 +36,10 @@
</span><span class="cx">     typedef ErrorInstance Base;
</span><span class="cx"> 
</span><span class="cx">     static JSWebAssemblyRuntimeError* create(ExecState*, Structure*, const String&amp;, bool);
</span><ins>+    static JSWebAssemblyRuntimeError* create(ExecState* exec, Structure* structure, JSValue message, bool useCurrentFrame)
+    {
+        return create(exec, structure, message.isUndefined() ? String() : message.toString(exec)-&gt;value(exec), useCurrentFrame);
+    }
</ins><span class="cx"> 
</span><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><span class="lines">@@ -42,3 +48,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;JSWebAssemblyTable.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -69,3 +71,5 @@
</span><span class="cx"> const ClassInfo JSWebAssemblyTable::s_info = { &quot;WebAssembly.Table&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyTable) };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -47,3 +49,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,8 +26,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyCompileErrorConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;JSWebAssemblyCompileError.h&quot;
</ins><span class="cx"> #include &quot;WebAssemblyCompileErrorPrototype.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebAssemblyCompileErrorConstructor.lut.h&quot;
</span><span class="lines">@@ -43,9 +46,12 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyCompileError(ExecState* state)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = state-&gt;vm();
</del><ins>+    auto&amp; vm = state-&gt;vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><del>-    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the CompileError constructor property&quot;))));
</del><ins>+    JSValue message = state-&gt;argumentCount() ? state-&gt;argument(0) : jsUndefined();
+    auto* structure = InternalFunction::createSubclassStructure(state, state-&gt;newTarget(), asInternalFunction(state-&gt;callee())-&gt;globalObject()-&gt;WebAssemblyCompileErrorStructure());
+    RETURN_IF_EXCEPTION(scope, encodedJSValue());
+    return JSValue::encode(JSWebAssemblyCompileError::create(state, structure, message, false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyCompileError(ExecState* state)
</span><span class="lines">@@ -67,12 +73,11 @@
</span><span class="cx">     return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAssemblyCompileErrorConstructor::finishCreation(VM&amp; vm, WebAssemblyCompileErrorPrototype* prototype, Structure* structure)
</del><ins>+void WebAssemblyCompileErrorConstructor::finishCreation(VM&amp; vm, WebAssemblyCompileErrorPrototype* prototype, Structure*)
</ins><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm, ASCIILiteral(&quot;CompileError&quot;));
</span><del>-    putDirectWithoutTransition(vm, vm.propertyNames-&gt;prototype, prototype, DontEnum | DontDelete | ReadOnly);
</del><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;prototype, prototype, ReadOnly | DontEnum | DontDelete);
</ins><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
</span><del>-    m_CompileErrorStructure.set(vm, this, structure);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor(VM&amp; vm, Structure* structure)
</span><span class="lines">@@ -92,12 +97,6 @@
</span><span class="cx">     return CallType::Host;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAssemblyCompileErrorConstructor::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
-{
-    auto* thisObject = jsCast&lt;WebAssemblyCompileErrorConstructor*&gt;(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-    visitor.append(&amp;thisObject-&gt;m_CompileErrorStructure);
-}
</del><ins>+} // namespace JSC
</ins><span class="cx"> 
</span><del>-} // namespace JSC
</del><ins>+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -42,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><del>-    Structure* CompileErrorStructure() const { return m_CompileErrorStructure.get(); }
-
</del><span class="cx"> protected:
</span><span class="cx">     void finishCreation(VM&amp;, WebAssemblyCompileErrorPrototype*, Structure*);
</span><span class="cx"> 
</span><span class="lines">@@ -51,9 +51,8 @@
</span><span class="cx">     WebAssemblyCompileErrorConstructor(VM&amp;, Structure*);
</span><span class="cx">     static ConstructType getConstructData(JSCell*, ConstructData&amp;);
</span><span class="cx">     static CallType getCallData(JSCell*, CallData&amp;);
</span><del>-    static void visitChildren(JSCell*, SlotVisitor&amp;);
-
-    WriteBarrier&lt;Structure&gt; m_CompileErrorStructure;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyCompileErrorPrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyInstanceConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyInstancePrototype.h&quot;
</span><span class="lines">@@ -101,3 +103,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyInstanceConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -57,3 +59,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyInstancePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyInstancePrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyInstancePrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyMemoryConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyMemoryPrototype.h&quot;
</span><span class="lines">@@ -101,3 +103,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -57,3 +59,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyMemoryPrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyModuleConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyModulePrototype.h&quot;
</span><span class="lines">@@ -101,3 +103,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -57,3 +59,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModulePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyModulePrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModulePrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyPrototypecppfromrev207649trunkSourceJavaScriptCorewasmjsWebAssemblyCompileErrorPrototypecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp (from rev 207649, trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp) (0 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebAssemblyPrototype.h&quot;
+
+#if ENABLE(WEBASSEMBLY)
+
+#include &quot;FunctionPrototype.h&quot;
+#include &quot;JSCInlines.h&quot;
+
+namespace JSC {
+
+static EncodedJSValue JSC_HOST_CALL webAssemblyFunctionValidate(ExecState* state)
+{
+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the validate function property&quot;))));
+}
+
+static EncodedJSValue JSC_HOST_CALL webAssemblyFunctionCompile(ExecState* state)
+{
+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the compile function property&quot;))));
+}
+
+}
+
+#include &quot;WebAssemblyPrototype.lut.h&quot;
+
+namespace JSC {
+
+const ClassInfo WebAssemblyPrototype::s_info = { &quot;WebAssembly.prototype&quot;, &amp;Base::s_info, &amp;prototypeTableWebAssembly, CREATE_METHOD_TABLE(WebAssemblyPrototype) };
+
+/* Source for WebAssemblyPrototype.lut.h
+ @begin prototypeTableWebAssembly
+ validate webAssemblyFunctionValidate  DontEnum|Function 1
+ compile  webAssemblyFunctionCompile   DontEnum|Function 1
+ @end
+ */
+
+WebAssemblyPrototype* WebAssemblyPrototype::create(VM&amp; vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell&lt;WebAssemblyPrototype&gt;(vm.heap)) WebAssemblyPrototype(vm, structure);
+    object-&gt;finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyPrototype::createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyPrototype::finishCreation(VM&amp; vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyPrototype::WebAssemblyPrototype(VM&amp; vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyPrototypehfromrev207649trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryPrototypeh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h (from rev 207649, trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h) (0 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBASSEMBLY)
+
+#include &quot;JSDestructibleObject.h&quot;
+#include &quot;JSObject.h&quot;
+
+namespace JSC {
+
+class WebAssemblyPrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyPrototype* create(VM&amp;, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&amp;, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&amp;);
+
+private:
+    WebAssemblyPrototype(VM&amp;, Structure*);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,8 +26,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyRuntimeErrorConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;JSWebAssemblyRuntimeError.h&quot;
</ins><span class="cx"> #include &quot;WebAssemblyRuntimeErrorPrototype.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebAssemblyRuntimeErrorConstructor.lut.h&quot;
</span><span class="lines">@@ -43,9 +46,12 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyRuntimeError(ExecState* state)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = state-&gt;vm();
</del><ins>+    auto&amp; vm = state-&gt;vm();
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><del>-    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral(&quot;WebAssembly doesn't yet implement the RuntimeError constructor property&quot;))));
</del><ins>+    JSValue message = state-&gt;argumentCount() ? state-&gt;argument(0) : jsUndefined();
+    auto* structure = InternalFunction::createSubclassStructure(state, state-&gt;newTarget(), asInternalFunction(state-&gt;callee())-&gt;globalObject()-&gt;WebAssemblyRuntimeErrorStructure());
+    RETURN_IF_EXCEPTION(scope, encodedJSValue());
+    return JSValue::encode(JSWebAssemblyRuntimeError::create(state, structure, message, false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyRuntimeError(ExecState* state)
</span><span class="lines">@@ -67,12 +73,11 @@
</span><span class="cx">     return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAssemblyRuntimeErrorConstructor::finishCreation(VM&amp; vm, WebAssemblyRuntimeErrorPrototype* prototype, Structure* structure)
</del><ins>+void WebAssemblyRuntimeErrorConstructor::finishCreation(VM&amp; vm, WebAssemblyRuntimeErrorPrototype* prototype, Structure*)
</ins><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm, ASCIILiteral(&quot;RuntimeError&quot;));
</span><del>-    putDirectWithoutTransition(vm, vm.propertyNames-&gt;prototype, prototype, DontEnum | DontDelete | ReadOnly);
</del><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;prototype, prototype, ReadOnly | DontEnum | DontDelete);
</ins><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
</span><del>-    m_RuntimeErrorStructure.set(vm, this, structure);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor(VM&amp; vm, Structure* structure)
</span><span class="lines">@@ -92,12 +97,6 @@
</span><span class="cx">     return CallType::Host;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAssemblyRuntimeErrorConstructor::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
-{
-    auto* thisObject = jsCast&lt;WebAssemblyRuntimeErrorConstructor*&gt;(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-    visitor.append(&amp;thisObject-&gt;m_RuntimeErrorStructure);
-}
</del><ins>+} // namespace JSC
</ins><span class="cx"> 
</span><del>-} // namespace JSC
</del><ins>+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -42,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><del>-    Structure* RuntimeErrorStructure() const { return m_RuntimeErrorStructure.get(); }
-
</del><span class="cx"> protected:
</span><span class="cx">     void finishCreation(VM&amp;, WebAssemblyRuntimeErrorPrototype*, Structure*);
</span><span class="cx"> 
</span><span class="lines">@@ -51,9 +51,8 @@
</span><span class="cx">     WebAssemblyRuntimeErrorConstructor(VM&amp;, Structure*);
</span><span class="cx">     static ConstructType getConstructData(JSCell*, ConstructData&amp;);
</span><span class="cx">     static CallType getCallData(JSCell*, CallData&amp;);
</span><del>-    static void visitChildren(JSCell*, SlotVisitor&amp;);
-
-    WriteBarrier&lt;Structure&gt; m_RuntimeErrorStructure;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyRuntimeErrorPrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyRuntimeErrorPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyTableConstructor.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyTablePrototype.h&quot;
</span><span class="lines">@@ -101,3 +103,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;InternalFunction.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -57,3 +59,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTablePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebAssemblyTablePrototype.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;FunctionPrototype.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -63,3 +65,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTablePrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h (207649 => 207650)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h        2016-10-21 01:17:31 UTC (rev 207649)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h        2016-10-21 01:19:24 UTC (rev 207650)
</span><span class="lines">@@ -25,6 +25,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+
</ins><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -48,3 +50,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><ins>+
+#endif // ENABLE(WEBASSEMBLY)
</ins></span></pre>
</div>
</div>

</body>
</html>