JavaScript WebAssembly API: baby steps
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 22:11:11 +0000 (22:11 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2016 22:11:11 +0000 (22:11 +0000)
 - Expand WebAssembly constructors into their own files. This requires a lot of
   boilerplate, as well as adding the .lut.h files. All of the
   JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
   currently the same between the 4 specified WebAssembly constructors. It'll be
   easy to implement individual functions on constructed objects as per the
   spec, and have each of these files diverge. The error constructors are also
   similar, except that their instance derives from ErrorInstance.
 - Use constructor macro when initializing the global object.
 - Dramatically improve testing of the WebAssembly API by checking for
   properties specified in the spec [*].
 - Clean up assert.js' exception testing.
 - Fix a copy-paste bug in wasm.json: floating-point const return values were
   swapped.

[*] https://github.com/WebAssembly/design/blob/master/JS.md

Implement more of the JavaScript WebAssembly API
https://bugs.webkit.org/show_bug.cgi?id=163571

Reviewed by Keith Miller.

JSTests:

* wasm/assert.js:
(export.const.isUndef): add this useful helper
(export.const.throws): fold other throw checks into this one, and check message as well
* wasm/js-api/test_basic_api.js:
(const.checkOwnPropertyDescriptor): check own property descriptor follows the spec
* wasm/self-test/test_BuilderJSON.js:
(const.assertOpThrows): use new assert API
(CheckedOpcodeArgumentsTooMany): ditto
(CheckedOpcodeArgumentsNotEnough): ditto
(CallInvalid): ditto
(I32ConstInvalid): ditto
(F32ConstInvalid): ditto (and this caugth the JSON copy-paste bug)
(F64ConstInvalid): ditto
* wasm/self-test/test_LowLevelBinary_varint.js: use new assert API
* wasm/self-test/test_LowLevelBinary_varuint.js: use new assert API
* wasm/utilities.js: add "global" object, used in basic API test (to access global.WebAssembly).
* wasm/wasm.json: fix copy-paste

Source/JavaScriptCore:

* CMakeLists.txt: add .lut.h generation
* DerivedSources.make: ditto
* JavaScriptCore.xcodeproj/project.pbxproj: add .lut.h generation and all the new files
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): use macro to list all constructors
* wasm/WebAssemblyObject.cpp: unboilerplate, all constructors into their own files
* wasm/WebAssemblyObject.h: ditto
* wasm/js/JSWebAssemblyCompileError.cpp: Added.
(JSC::JSWebAssemblyCompileError::create):
(JSC::JSWebAssemblyCompileError::createStructure):
(JSC::JSWebAssemblyCompileError::JSWebAssemblyCompileError):
(JSC::JSWebAssemblyCompileError::finishCreation):
(JSC::JSWebAssemblyCompileError::destroy):
(JSC::JSWebAssemblyCompileError::visitChildren):
* wasm/js/JSWebAssemblyCompileError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyInstance.cpp: Added.
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::createStructure):
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::destroy):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyMemory.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::createStructure):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::finishCreation):
(JSC::JSWebAssemblyMemory::destroy):
(JSC::JSWebAssemblyMemory::visitChildren):
* wasm/js/JSWebAssemblyMemory.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyModule.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyModule::create):
(JSC::JSWebAssemblyModule::createStructure):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::finishCreation):
(JSC::JSWebAssemblyModule::destroy):
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyModule.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyRuntimeError.cpp: Added.
(JSC::JSWebAssemblyRuntimeError::create):
(JSC::JSWebAssemblyRuntimeError::createStructure):
(JSC::JSWebAssemblyRuntimeError::JSWebAssemblyRuntimeError):
(JSC::JSWebAssemblyRuntimeError::finishCreation):
(JSC::JSWebAssemblyRuntimeError::destroy):
(JSC::JSWebAssemblyRuntimeError::visitChildren):
* wasm/js/JSWebAssemblyRuntimeError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyTable.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::createStructure):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::finishCreation):
(JSC::JSWebAssemblyTable::destroy):
(JSC::JSWebAssemblyTable::visitChildren):
* wasm/js/JSWebAssemblyTable.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyCompileErrorConstructor.cpp: Added.
(JSC::constructJSWebAssemblyCompileError):
(JSC::callJSWebAssemblyCompileError):
(JSC::WebAssemblyCompileErrorConstructor::create):
(JSC::WebAssemblyCompileErrorConstructor::createStructure):
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):
(JSC::WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor):
(JSC::WebAssemblyCompileErrorConstructor::getConstructData):
(JSC::WebAssemblyCompileErrorConstructor::getCallData):
(JSC::WebAssemblyCompileErrorConstructor::visitChildren):
* wasm/js/WebAssemblyCompileErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyCompileErrorConstructor::CompileErrorStructure):
* wasm/js/WebAssemblyCompileErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyCompileErrorPrototype::create):
(JSC::WebAssemblyCompileErrorPrototype::createStructure):
(JSC::WebAssemblyCompileErrorPrototype::finishCreation):
(JSC::WebAssemblyCompileErrorPrototype::WebAssemblyCompileErrorPrototype):
* wasm/js/WebAssemblyCompileErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyInstanceConstructor.cpp: Added.
(JSC::constructJSWebAssemblyInstance):
(JSC::callJSWebAssemblyInstance):
(JSC::WebAssemblyInstanceConstructor::create):
(JSC::WebAssemblyInstanceConstructor::createStructure):
(JSC::WebAssemblyInstanceConstructor::finishCreation):
(JSC::WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor):
(JSC::WebAssemblyInstanceConstructor::getConstructData):
(JSC::WebAssemblyInstanceConstructor::getCallData):
(JSC::WebAssemblyInstanceConstructor::visitChildren):
* wasm/js/WebAssemblyInstanceConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyInstanceConstructor::InstanceStructure):
* wasm/js/WebAssemblyInstancePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyInstancePrototype::create):
(JSC::WebAssemblyInstancePrototype::createStructure):
(JSC::WebAssemblyInstancePrototype::finishCreation):
(JSC::WebAssemblyInstancePrototype::WebAssemblyInstancePrototype):
* wasm/js/WebAssemblyInstancePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyMemoryConstructor.cpp: Added.
(JSC::constructJSWebAssemblyMemory):
(JSC::callJSWebAssemblyMemory):
(JSC::WebAssemblyMemoryConstructor::create):
(JSC::WebAssemblyMemoryConstructor::createStructure):
(JSC::WebAssemblyMemoryConstructor::finishCreation):
(JSC::WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor):
(JSC::WebAssemblyMemoryConstructor::getConstructData):
(JSC::WebAssemblyMemoryConstructor::getCallData):
(JSC::WebAssemblyMemoryConstructor::visitChildren):
* wasm/js/WebAssemblyMemoryConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyMemoryConstructor::MemoryStructure):
* wasm/js/WebAssemblyMemoryPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyMemoryPrototype::create):
(JSC::WebAssemblyMemoryPrototype::createStructure):
(JSC::WebAssemblyMemoryPrototype::finishCreation):
(JSC::WebAssemblyMemoryPrototype::WebAssemblyMemoryPrototype):
* wasm/js/WebAssemblyMemoryPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyModuleConstructor.cpp: Added.
(JSC::constructJSWebAssemblyModule):
(JSC::callJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::create):
(JSC::WebAssemblyModuleConstructor::createStructure):
(JSC::WebAssemblyModuleConstructor::finishCreation):
(JSC::WebAssemblyModuleConstructor::WebAssemblyModuleConstructor):
(JSC::WebAssemblyModuleConstructor::getConstructData):
(JSC::WebAssemblyModuleConstructor::getCallData):
(JSC::WebAssemblyModuleConstructor::visitChildren):
* wasm/js/WebAssemblyModuleConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyModuleConstructor::ModuleStructure):
* wasm/js/WebAssemblyModulePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyModulePrototype::create):
(JSC::WebAssemblyModulePrototype::createStructure):
(JSC::WebAssemblyModulePrototype::finishCreation):
(JSC::WebAssemblyModulePrototype::WebAssemblyModulePrototype):
* wasm/js/WebAssemblyModulePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp: Added.
(JSC::constructJSWebAssemblyRuntimeError):
(JSC::callJSWebAssemblyRuntimeError):
(JSC::WebAssemblyRuntimeErrorConstructor::create):
(JSC::WebAssemblyRuntimeErrorConstructor::createStructure):
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):
(JSC::WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor):
(JSC::WebAssemblyRuntimeErrorConstructor::getConstructData):
(JSC::WebAssemblyRuntimeErrorConstructor::getCallData):
(JSC::WebAssemblyRuntimeErrorConstructor::visitChildren):
* wasm/js/WebAssemblyRuntimeErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyRuntimeErrorConstructor::RuntimeErrorStructure):
* wasm/js/WebAssemblyRuntimeErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyRuntimeErrorPrototype::create):
(JSC::WebAssemblyRuntimeErrorPrototype::createStructure):
(JSC::WebAssemblyRuntimeErrorPrototype::finishCreation):
(JSC::WebAssemblyRuntimeErrorPrototype::WebAssemblyRuntimeErrorPrototype):
* wasm/js/WebAssemblyRuntimeErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyTableConstructor.cpp: Added.
(JSC::constructJSWebAssemblyTable):
(JSC::callJSWebAssemblyTable):
(JSC::WebAssemblyTableConstructor::create):
(JSC::WebAssemblyTableConstructor::createStructure):
(JSC::WebAssemblyTableConstructor::finishCreation):
(JSC::WebAssemblyTableConstructor::WebAssemblyTableConstructor):
(JSC::WebAssemblyTableConstructor::getConstructData):
(JSC::WebAssemblyTableConstructor::getCallData):
(JSC::WebAssemblyTableConstructor::visitChildren):
* wasm/js/WebAssemblyTableConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyTableConstructor::TableStructure):
* wasm/js/WebAssemblyTablePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::createStructure):
(JSC::WebAssemblyTablePrototype::finishCreation):
(JSC::WebAssemblyTablePrototype::WebAssemblyTablePrototype):
* wasm/js/WebAssemblyTablePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

51 files changed:
JSTests/ChangeLog
JSTests/wasm/assert.js
JSTests/wasm/js-api/test_basic_api.js
JSTests/wasm/self-test/test_BuilderJSON.js
JSTests/wasm/self-test/test_LowLevelBinary_varint.js
JSTests/wasm/self-test/test_LowLevelBinary_varuint.js
JSTests/wasm/utilities.js
JSTests/wasm/wasm.json
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/wasm/WebAssemblyObject.cpp
Source/JavaScriptCore/wasm/WebAssemblyObject.h
Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h [new file with mode: 0644]

index ccb2f7a..03d8303 100644 (file)
@@ -1,3 +1,46 @@
+2016-10-19  JF Bastien  <jfbastien@apple.com>
+
+        JavaScript WebAssembly API: baby steps
+
+         - Expand WebAssembly constructors into their own files. This requires a lot of
+           boilerplate, as well as adding the .lut.h files. All of the
+           JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
+           currently the same between the 4 specified WebAssembly constructors. It'll be
+           easy to implement individual functions on constructed objects as per the
+           spec, and have each of these files diverge. The error constructors are also
+           similar, except that their instance derives from ErrorInstance.
+         - Use constructor macro when initializing the global object.
+         - Dramatically improve testing of the WebAssembly API by checking for
+           properties specified in the spec [*].
+         - Clean up assert.js' exception testing.
+         - Fix a copy-paste bug in wasm.json: floating-point const return values were
+           swapped.
+
+        [*] https://github.com/WebAssembly/design/blob/master/JS.md
+
+        Implement more of the JavaScript WebAssembly API
+        https://bugs.webkit.org/show_bug.cgi?id=163571
+
+        Reviewed by Keith Miller.
+
+        * wasm/assert.js:
+        (export.const.isUndef): add this useful helper
+        (export.const.throws): fold other throw checks into this one, and check message as well
+        * wasm/js-api/test_basic_api.js:
+        (const.checkOwnPropertyDescriptor): check own property descriptor follows the spec
+        * wasm/self-test/test_BuilderJSON.js:
+        (const.assertOpThrows): use new assert API
+        (CheckedOpcodeArgumentsTooMany): ditto
+        (CheckedOpcodeArgumentsNotEnough): ditto
+        (CallInvalid): ditto
+        (I32ConstInvalid): ditto
+        (F32ConstInvalid): ditto (and this caugth the JSON copy-paste bug)
+        (F64ConstInvalid): ditto
+        * wasm/self-test/test_LowLevelBinary_varint.js: use new assert API
+        * wasm/self-test/test_LowLevelBinary_varuint.js: use new assert API
+        * wasm/utilities.js: add "global" object, used in basic API test (to access global.WebAssembly).
+        * wasm/wasm.json: fix copy-paste
+
 2016-10-19  Caitlin Potter  <caitp@igalia.com>
 
         [JSC] forbid "use strict" directive in generator functions with non-simple parameters
index a114b33..5c71cc4 100644 (file)
  */
 
 export const notUndef = (v) => {
-    if (v === undefined)
+    if (typeof v === "undefined")
         throw new Error("Shouldn't be undefined");
 };
 
+export const isUndef = (v) => {
+    if (typeof v !== "undefined")
+        throw new Error("Should be undefined");
+};
+
 export const eq = (lhs, rhs) => {
     if (lhs !== rhs)
         throw new Error(`Not the same: "${lhs}" and "${rhs}"`);
@@ -40,30 +45,13 @@ export const ge = (lhs, rhs) => {
         throw new Error(`Expected: "${lhs}" < "${rhs}"`);
 };
 
-export const throwsError = (opFn, message, ...args) => {
-    if (message)
-        message = " for " + message;
-
-    try {
-        opFn(...args);
-    } catch (e) {
-        if (e instanceof Error)
-            return;
-        throw new Error(`Expected an Error${message}, got ${e}`);
-    }
-    throw new Error(`Expected to throw an Error${message}`);
-};
-
-export const throwsRangeError = (opFn, message, ...args) => {
-    if (message)
-        message = " for " + message;
-
+export const throws = (func, type, message, ...args) => {
     try {
-        opFn(...args);
+        func(...args);
     } catch (e) {
-        if (e instanceof RangeError)
+        if (e instanceof type && e.message === message)
             return;
-        throw new Error(`Expected a RangeError${message}, got ${e}`);
+        throw new Error(`Expected to throw a ${type.name} with message "${message}", got ${e.name} with message "${e.message}"`);
     }
-    throw new Error(`Expected to throw a RangeError${message}`);
+    throw new Error(`Expected to throw a ${type.name} with message "${message}"`);
 };
index 1953cb0..bbd50b5 100644 (file)
@@ -1,37 +1,55 @@
-if (WebAssembly === undefined)
-    throw new Error("Couldn't find WebAssembly global object");
-
-const functionProperties = ["validate", "compile"];
-const constructorProperties = ["Module", "Instance", "Memory", "Table", "CompileError"];
-
-for (const f of functionProperties)
-    if (WebAssembly[f] === undefined)
-        throw new Error(`Couldn't find WebAssembly function property "${f}"`);
-
-for (const c of constructorProperties)
-    if (WebAssembly[c] === undefined)
-        throw new Error(`Couldn't find WebAssembly constructor property "${c}"`);
-
-// FIXME https://bugs.webkit.org/show_bug.cgi?id=159775 Implement and test these APIs further. For now they just throw.
-
-for (const f of functionProperties) {
-    try {
-        WebAssembly[f]();
-    } catch (e) {
-        if (e instanceof Error)
-            continue;
-        throw new Error(`Expected WebAssembly.${f}() to throw an Error, got ${e}`);
-    }
-    throw new Error(`Expected WebAssembly.${f}() to throw an Error`);
+import * as assert from '../assert.js';
+import * as utilities from '../utilities.js';
+
+const checkOwnPropertyDescriptor = (obj, prop, expect) => {
+    const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
+    assert.eq(typeof descriptor.value, expect.typeofvalue);
+    assert.eq(descriptor.writable, expect.writable);
+    assert.eq(descriptor.configurable, expect.configurable);
+    assert.eq(descriptor.enumerable, expect.enumerable);
+};
+
+const functionProperties = {
+    "validate": { length: 1 },
+    "compile":  { length: 1 },
+};
+const constructorProperties = {
+    "Module":       { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: false },
+    "Instance":     { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: false },
+    "Memory":       { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: false },
+    "Table":        { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: false },
+    "CompileError": { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: true  },
+    "RuntimeError": { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1, isError: true  },
+};
+
+
+assert.notUndef(WebAssembly);
+checkOwnPropertyDescriptor(utilities.global, "WebAssembly", { typeofvalue: "object", writable: true, configurable: true, enumerable: false });
+assert.eq(String(WebAssembly), "[object WebAssembly]");
+assert.isUndef(WebAssembly.length);
+
+for (const f in functionProperties) {
+    assert.notUndef(WebAssembly[f]);
+    assert.eq(WebAssembly[f].name, f);
+    assert.eq(WebAssembly[f].length, functionProperties[f].length);
 }
 
-for (const c of constructorProperties) {
-    try {
-        let v = new WebAssembly[c]();
-    } catch (e) {
-        if (e instanceof Error)
-            continue;
-        throw new Error(`Expected new WebAssembly.${f}() to throw an Error, got ${e}`);
-    }
-    throw new Error(`Expected new WebAssembly.${f}() to throw an Error`);
+for (const c in constructorProperties) {
+    assert.notUndef(WebAssembly[c]);
+    assert.eq(WebAssembly[c].name, c);
+    assert.eq(WebAssembly[c].length, constructorProperties[c].length);
+    checkOwnPropertyDescriptor(WebAssembly, c, constructorProperties[c]);
+    // Check the constructor's prototype.
+    checkOwnPropertyDescriptor(WebAssembly[c], "prototype", { typeofvalue: "object", writable: false, configurable: false, enumerable: false });
+    assert.eq(String(WebAssembly[c].prototype), `[object WebAssembly.${c}.prototype]`);
+    assert.throws(() => WebAssembly[c](), TypeError, `calling WebAssembly.${c} constructor without new is invalid`);
 }
+
+// FIXME Implement and test these APIs further. For now they just throw. https://bugs.webkit.org/show_bug.cgi?id=159775
+
+for (const f in functionProperties) {
+    assert.throws(() => WebAssembly[f](), Error, `WebAssembly doesn't yet implement the ${f} function property`);
+}
+
+for (const c in constructorProperties)
+    assert.throws(() => new WebAssembly[c](), Error, `WebAssembly doesn't yet implement the ${c} constructor property`);
index ac9b81f..0934231 100644 (file)
@@ -1,9 +1,9 @@
 import * as assert from '../assert.js';
 import Builder from '../Builder.js';
 
-const assertOpThrows = (opFn, message = "") => {
+const assertOpThrows = (opFn, message) => {
     let f = (new Builder()).Code().Function();
-    assert.throwsError(opFn, message, f);
+    assert.throws(opFn, Error, message, f);
 };
 
 (function EmptyModule() {
@@ -193,7 +193,7 @@ const assertOpThrows = (opFn, message = "") => {
 })();
 
 (function CheckedOpcodeArgumentsTooMany() {
-    assertOpThrows(f => f.Nop("uh-oh!"));
+    assertOpThrows(f => f.Nop("uh-oh!"), `"nop" expects 0 immediates, got 1`);
 })();
 
 (function UncheckedOpcodeArgumentsTooMany() {
@@ -201,7 +201,7 @@ const assertOpThrows = (opFn, message = "") => {
 })();
 
 (function CheckedOpcodeArgumentsNotEnough() {
-    assertOpThrows(f => f.I32Const());
+    assertOpThrows(f => f.I32Const(), `"i32.const" expects 1 immediates, got 0`);
 })();
 
 (function UncheckedOpcodeArgumentsNotEnough() {
@@ -221,7 +221,7 @@ const assertOpThrows = (opFn, message = "") => {
 
 (function CallInvalid() {
     for (let c of [-1, 0x100000000, "0", {}, Infinity, -Infinity, NaN, -NaN, null])
-        assertOpThrows(f => f.Call(c), c);
+        assertOpThrows(f => f.Call(c), `Invalid value on call: got "${c}", expected i32`);
 })();
 
 (function I32ConstValid() {
@@ -237,7 +237,7 @@ const assertOpThrows = (opFn, message = "") => {
 
 (function I32ConstInvalid() {
     for (let c of [-1, 0x100000000, 0.1, -0.1, "0", {}, Infinity, null])
-        assertOpThrows(f => f.I32Const(c), c);
+        assertOpThrows(f => f.I32Const(c), `Invalid value on i32.const: got "${c}", expected i32`);
 })();
 
 // FIXME: test i64. https://bugs.webkit.org/show_bug.cgi?id=163420
@@ -255,7 +255,7 @@ const assertOpThrows = (opFn, message = "") => {
 
 (function F32ConstInvalid() {
     for (let c of ["0", {}, Infinity, -Infinity, NaN, -NaN, null])
-        assertOpThrows(f => f.F32Const(c), c);
+        assertOpThrows(f => f.F32Const(c), `Invalid value on f32.const: got "${c}", expected f32`);
 })();
 
 (function F64ConstValid() {
@@ -271,7 +271,7 @@ const assertOpThrows = (opFn, message = "") => {
 
 (function F64ConstInvalid() {
     for (let c of ["0", {}, Infinity, -Infinity, NaN, -NaN, null])
-        assertOpThrows(f => f.F64Const(c), c);
+        assertOpThrows(f => f.F64Const(c), `Invalid value on f64.const: got "${c}", expected f64`);
 })();
 
 (function CallOneFromStack() {
index b2c2d81..7ddc8cf 100644 (file)
@@ -20,11 +20,11 @@ for (let i = 0; i < LLB.varBitsMax + 1; ++i) {
     let b = new LowLevelBinary();
     for (let j = 0; j < i; ++j)
         b.uint8(0x80);
-    assert.throwsRangeError(() => b.getVarint(0));
+    assert.throws(() => b.getVarint(0), RangeError, `[${i}, ${i+1}) is out of buffer range [0, ${i})`);
 }
 
 let b = new LowLevelBinary();
 for (let i = 0; i < LLB.varBitsMax; ++i)
     b.uint8(0x80);
 b.uint8(0x00);
-assert.throwsRangeError(() => b.getVarint(0));
+assert.throws(() => b.getVarint(0), RangeError, `Shifting too much at 6`);
index e8b9cbb..be82e13 100644 (file)
@@ -19,11 +19,11 @@ for (let i = 0; i < LLB.varBitsMax + 1; ++i) {
     let b = new LowLevelBinary();
     for (let j = 0; j < i; ++j)
         b.uint8(0x80);
-    assert.throwsRangeError(() => b.getVaruint(0));
+    assert.throws(() => b.getVarint(0), RangeError, `[${i}, ${i+1}) is out of buffer range [0, ${i})`);
 }
 
 let b = new LowLevelBinary();
 for (let i = 0; i < LLB.varBitsMax; ++i)
     b.uint8(0x80);
 b.uint8(0x00);
-assert.throwsRangeError(() => b.getVaruint(0));
+assert.throws(() => b.getVarint(0), RangeError, `Shifting too much at 6`);
index 7c63867..6daa7be 100644 (file)
@@ -30,6 +30,13 @@ const _environment =
         : (typeof importScripts === "function" ? "worker"
            : "shell")));
 
+let _global = (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array)
+    ? ((typeof self !== 'undefined') ? self
+       : (typeof window !== 'undefined') ? window
+       : (typeof global !== 'undefined') ? global
+       : Function('return this')())
+    : global;
+
 const _eval = x => eval.call(null, x);
 
 const _read = filename => {
@@ -60,4 +67,4 @@ const _json = filename => {
 }
 
 // Use underscore names to avoid clashing with builtin names.
-export { _eval as eval, _read as read, _load as load, _json as json };
+export { _eval as eval, _read as read, _load as load, _json as json, _global as global };
index 55a0eee..a8239d1 100644 (file)
@@ -58,8 +58,8 @@
         "end":                 { "category": "control",    "value":  15, "return": [],           "parameter": [],                       "immediate": [],                                                                                         "description": "end a block, loop, or if" },
         "i32.const":           { "category": "special",    "value":  16, "return": ["i32"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "varint32"}],                                           "description": "a constant value interpreted as i32" },
         "i64.const":           { "category": "special",    "value":  17, "return": ["i64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "varint64"}],                                           "description": "a constant value interpreted as i64" },
-        "f64.const":           { "category": "special",    "value":  18, "return": ["f32"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "uint64"}],                                             "description": "a constant value interpreted as f64" },
-        "f32.const":           { "category": "special",    "value":  19, "return": ["f64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "uint32"}],                                             "description": "a constant value interpreted as f32" },
+        "f64.const":           { "category": "special",    "value":  18, "return": ["f64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "uint64"}],                                             "description": "a constant value interpreted as f64" },
+        "f32.const":           { "category": "special",    "value":  19, "return": ["f32"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "uint32"}],                                             "description": "a constant value interpreted as f32" },
         "get_local":           { "category": "special",    "value":  20, "return": ["local"],    "parameter": [],                       "immediate": [{"name": "local_index",    "type": "varuint32"}],                                          "description": "read a local variable or parameter" },
         "set_local":           { "category": "special",    "value":  21, "return": [],           "parameter": ["local"],                "immediate": [{"name": "local_index",    "type": "varuint32"}],                                          "description": "write a local variable or parameter" },
         "tee_local":           { "category": "special",    "value":  25, "return": ["prev"],     "parameter": ["any"],                  "immediate": [{"name": "local_index",    "type": "varuint32"}],                                          "description": "write a local variable or parameter and return the same value" },
index 1e93d4b..968d075 100644 (file)
@@ -868,6 +868,25 @@ set(JavaScriptCore_SOURCES
     wasm/WASMPlan.cpp
     wasm/WebAssemblyObject.cpp
 
+    wasm/js/JSWebAssemblyCompileError.cpp
+    wasm/js/JSWebAssemblyInstance.cpp
+    wasm/js/JSWebAssemblyMemory.cpp
+    wasm/js/JSWebAssemblyModule.cpp
+    wasm/js/JSWebAssemblyRuntimeError.cpp
+    wasm/js/JSWebAssemblyTable.cpp
+    wasm/js/WebAssemblyCompileErrorConstructor.cpp
+    wasm/js/WebAssemblyCompileErrorPrototype.cpp
+    wasm/js/WebAssemblyInstanceConstructor.cpp
+    wasm/js/WebAssemblyInstancePrototype.cpp
+    wasm/js/WebAssemblyMemoryConstructor.cpp
+    wasm/js/WebAssemblyMemoryPrototype.cpp
+    wasm/js/WebAssemblyModuleConstructor.cpp
+    wasm/js/WebAssemblyModulePrototype.cpp
+    wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
+    wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
+    wasm/js/WebAssemblyTableConstructor.cpp
+    wasm/js/WebAssemblyTablePrototype.cpp
+
     yarr/RegularExpression.cpp
     yarr/YarrCanonicalizeUCS2.cpp
     yarr/YarrInterpreter.cpp
@@ -918,6 +937,19 @@ set(JavaScriptCore_OBJECT_LUT_SOURCES
     runtime/StringPrototype.cpp
     runtime/SymbolConstructor.cpp
     runtime/SymbolPrototype.cpp
+
+    wasm/js/WebAssemblyCompileErrorConstructor.cpp
+    wasm/js/WebAssemblyCompileErrorPrototype.cpp
+    wasm/js/WebAssemblyInstanceConstructor.cpp
+    wasm/js/WebAssemblyInstancePrototype.cpp
+    wasm/js/WebAssemblyMemoryConstructor.cpp
+    wasm/js/WebAssemblyMemoryPrototype.cpp
+    wasm/js/WebAssemblyModuleConstructor.cpp
+    wasm/js/WebAssemblyModulePrototype.cpp
+    wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
+    wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
+    wasm/js/WebAssemblyTableConstructor.cpp
+    wasm/js/WebAssemblyTablePrototype.cpp
 )
 
 set(JavaScriptCore_LIBRARIES
index c70f67f..454212d 100644 (file)
@@ -1,3 +1,192 @@
+2016-10-19  JF Bastien  <jfbastien@apple.com>
+
+        JavaScript WebAssembly API: baby steps
+
+         - Expand WebAssembly constructors into their own files. This requires a lot of
+           boilerplate, as well as adding the .lut.h files. All of the
+           JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
+           currently the same between the 4 specified WebAssembly constructors. It'll be
+           easy to implement individual functions on constructed objects as per the
+           spec, and have each of these files diverge. The error constructors are also
+           similar, except that their instance derives from ErrorInstance.
+         - Use constructor macro when initializing the global object.
+         - Dramatically improve testing of the WebAssembly API by checking for
+           properties specified in the spec [*].
+         - Clean up assert.js' exception testing.
+         - Fix a copy-paste bug in wasm.json: floating-point const return values were
+           swapped.
+
+        [*] https://github.com/WebAssembly/design/blob/master/JS.md
+
+        Implement more of the JavaScript WebAssembly API
+        https://bugs.webkit.org/show_bug.cgi?id=163571
+
+        Reviewed by Keith Miller.
+
+        * CMakeLists.txt: add .lut.h generation
+        * DerivedSources.make: ditto
+        * JavaScriptCore.xcodeproj/project.pbxproj: add .lut.h generation and all the new files
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init): use macro to list all constructors
+        * wasm/WebAssemblyObject.cpp: unboilerplate, all constructors into their own files
+        * wasm/WebAssemblyObject.h: ditto
+        * wasm/js/JSWebAssemblyCompileError.cpp: Added.
+        (JSC::JSWebAssemblyCompileError::create):
+        (JSC::JSWebAssemblyCompileError::createStructure):
+        (JSC::JSWebAssemblyCompileError::JSWebAssemblyCompileError):
+        (JSC::JSWebAssemblyCompileError::finishCreation):
+        (JSC::JSWebAssemblyCompileError::destroy):
+        (JSC::JSWebAssemblyCompileError::visitChildren):
+        * wasm/js/JSWebAssemblyCompileError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/JSWebAssemblyInstance.cpp: Added.
+        (JSC::JSWebAssemblyInstance::create):
+        (JSC::JSWebAssemblyInstance::createStructure):
+        (JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
+        (JSC::JSWebAssemblyInstance::finishCreation):
+        (JSC::JSWebAssemblyInstance::destroy):
+        (JSC::JSWebAssemblyInstance::visitChildren):
+        * wasm/js/JSWebAssemblyInstance.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/JSWebAssemblyMemory.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::JSWebAssemblyMemory::create):
+        (JSC::JSWebAssemblyMemory::createStructure):
+        (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
+        (JSC::JSWebAssemblyMemory::finishCreation):
+        (JSC::JSWebAssemblyMemory::destroy):
+        (JSC::JSWebAssemblyMemory::visitChildren):
+        * wasm/js/JSWebAssemblyMemory.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/JSWebAssemblyModule.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::JSWebAssemblyModule::create):
+        (JSC::JSWebAssemblyModule::createStructure):
+        (JSC::JSWebAssemblyModule::JSWebAssemblyModule):
+        (JSC::JSWebAssemblyModule::finishCreation):
+        (JSC::JSWebAssemblyModule::destroy):
+        (JSC::JSWebAssemblyModule::visitChildren):
+        * wasm/js/JSWebAssemblyModule.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/JSWebAssemblyRuntimeError.cpp: Added.
+        (JSC::JSWebAssemblyRuntimeError::create):
+        (JSC::JSWebAssemblyRuntimeError::createStructure):
+        (JSC::JSWebAssemblyRuntimeError::JSWebAssemblyRuntimeError):
+        (JSC::JSWebAssemblyRuntimeError::finishCreation):
+        (JSC::JSWebAssemblyRuntimeError::destroy):
+        (JSC::JSWebAssemblyRuntimeError::visitChildren):
+        * wasm/js/JSWebAssemblyRuntimeError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/JSWebAssemblyTable.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::JSWebAssemblyTable::create):
+        (JSC::JSWebAssemblyTable::createStructure):
+        (JSC::JSWebAssemblyTable::JSWebAssemblyTable):
+        (JSC::JSWebAssemblyTable::finishCreation):
+        (JSC::JSWebAssemblyTable::destroy):
+        (JSC::JSWebAssemblyTable::visitChildren):
+        * wasm/js/JSWebAssemblyTable.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyCompileErrorConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyCompileError):
+        (JSC::callJSWebAssemblyCompileError):
+        (JSC::WebAssemblyCompileErrorConstructor::create):
+        (JSC::WebAssemblyCompileErrorConstructor::createStructure):
+        (JSC::WebAssemblyCompileErrorConstructor::finishCreation):
+        (JSC::WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor):
+        (JSC::WebAssemblyCompileErrorConstructor::getConstructData):
+        (JSC::WebAssemblyCompileErrorConstructor::getCallData):
+        (JSC::WebAssemblyCompileErrorConstructor::visitChildren):
+        * wasm/js/WebAssemblyCompileErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyCompileErrorConstructor::CompileErrorStructure):
+        * wasm/js/WebAssemblyCompileErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyCompileErrorPrototype::create):
+        (JSC::WebAssemblyCompileErrorPrototype::createStructure):
+        (JSC::WebAssemblyCompileErrorPrototype::finishCreation):
+        (JSC::WebAssemblyCompileErrorPrototype::WebAssemblyCompileErrorPrototype):
+        * wasm/js/WebAssemblyCompileErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyInstanceConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyInstance):
+        (JSC::callJSWebAssemblyInstance):
+        (JSC::WebAssemblyInstanceConstructor::create):
+        (JSC::WebAssemblyInstanceConstructor::createStructure):
+        (JSC::WebAssemblyInstanceConstructor::finishCreation):
+        (JSC::WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor):
+        (JSC::WebAssemblyInstanceConstructor::getConstructData):
+        (JSC::WebAssemblyInstanceConstructor::getCallData):
+        (JSC::WebAssemblyInstanceConstructor::visitChildren):
+        * wasm/js/WebAssemblyInstanceConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyInstanceConstructor::InstanceStructure):
+        * wasm/js/WebAssemblyInstancePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyInstancePrototype::create):
+        (JSC::WebAssemblyInstancePrototype::createStructure):
+        (JSC::WebAssemblyInstancePrototype::finishCreation):
+        (JSC::WebAssemblyInstancePrototype::WebAssemblyInstancePrototype):
+        * wasm/js/WebAssemblyInstancePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyMemoryConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyMemory):
+        (JSC::callJSWebAssemblyMemory):
+        (JSC::WebAssemblyMemoryConstructor::create):
+        (JSC::WebAssemblyMemoryConstructor::createStructure):
+        (JSC::WebAssemblyMemoryConstructor::finishCreation):
+        (JSC::WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor):
+        (JSC::WebAssemblyMemoryConstructor::getConstructData):
+        (JSC::WebAssemblyMemoryConstructor::getCallData):
+        (JSC::WebAssemblyMemoryConstructor::visitChildren):
+        * wasm/js/WebAssemblyMemoryConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyMemoryConstructor::MemoryStructure):
+        * wasm/js/WebAssemblyMemoryPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyMemoryPrototype::create):
+        (JSC::WebAssemblyMemoryPrototype::createStructure):
+        (JSC::WebAssemblyMemoryPrototype::finishCreation):
+        (JSC::WebAssemblyMemoryPrototype::WebAssemblyMemoryPrototype):
+        * wasm/js/WebAssemblyMemoryPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyModuleConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyModule):
+        (JSC::callJSWebAssemblyModule):
+        (JSC::WebAssemblyModuleConstructor::create):
+        (JSC::WebAssemblyModuleConstructor::createStructure):
+        (JSC::WebAssemblyModuleConstructor::finishCreation):
+        (JSC::WebAssemblyModuleConstructor::WebAssemblyModuleConstructor):
+        (JSC::WebAssemblyModuleConstructor::getConstructData):
+        (JSC::WebAssemblyModuleConstructor::getCallData):
+        (JSC::WebAssemblyModuleConstructor::visitChildren):
+        * wasm/js/WebAssemblyModuleConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyModuleConstructor::ModuleStructure):
+        * wasm/js/WebAssemblyModulePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyModulePrototype::create):
+        (JSC::WebAssemblyModulePrototype::createStructure):
+        (JSC::WebAssemblyModulePrototype::finishCreation):
+        (JSC::WebAssemblyModulePrototype::WebAssemblyModulePrototype):
+        * wasm/js/WebAssemblyModulePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyRuntimeError):
+        (JSC::callJSWebAssemblyRuntimeError):
+        (JSC::WebAssemblyRuntimeErrorConstructor::create):
+        (JSC::WebAssemblyRuntimeErrorConstructor::createStructure):
+        (JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):
+        (JSC::WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor):
+        (JSC::WebAssemblyRuntimeErrorConstructor::getConstructData):
+        (JSC::WebAssemblyRuntimeErrorConstructor::getCallData):
+        (JSC::WebAssemblyRuntimeErrorConstructor::visitChildren):
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyRuntimeErrorConstructor::RuntimeErrorStructure):
+        * wasm/js/WebAssemblyRuntimeErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyRuntimeErrorPrototype::create):
+        (JSC::WebAssemblyRuntimeErrorPrototype::createStructure):
+        (JSC::WebAssemblyRuntimeErrorPrototype::finishCreation):
+        (JSC::WebAssemblyRuntimeErrorPrototype::WebAssemblyRuntimeErrorPrototype):
+        * wasm/js/WebAssemblyRuntimeErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        * wasm/js/WebAssemblyTableConstructor.cpp: Added.
+        (JSC::constructJSWebAssemblyTable):
+        (JSC::callJSWebAssemblyTable):
+        (JSC::WebAssemblyTableConstructor::create):
+        (JSC::WebAssemblyTableConstructor::createStructure):
+        (JSC::WebAssemblyTableConstructor::finishCreation):
+        (JSC::WebAssemblyTableConstructor::WebAssemblyTableConstructor):
+        (JSC::WebAssemblyTableConstructor::getConstructData):
+        (JSC::WebAssemblyTableConstructor::getCallData):
+        (JSC::WebAssemblyTableConstructor::visitChildren):
+        * wasm/js/WebAssemblyTableConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyTableConstructor::TableStructure):
+        * wasm/js/WebAssemblyTablePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+        (JSC::WebAssemblyTablePrototype::create):
+        (JSC::WebAssemblyTablePrototype::createStructure):
+        (JSC::WebAssemblyTablePrototype::finishCreation):
+        (JSC::WebAssemblyTablePrototype::WebAssemblyTablePrototype):
+        * wasm/js/WebAssemblyTablePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
+
 2016-10-19  Caitlin Potter  <caitp@igalia.com>
 
         [JSC] forbid "use strict" directive in generator functions with non-simple parameters
index b5336a6..eecb53c 100644 (file)
@@ -28,9 +28,10 @@ VPATH = \
     $(JavaScriptCore) \
     $(JavaScriptCore)/parser \
     $(JavaScriptCore)/runtime \
-       $(JavaScriptCore)/interpreter \
-       $(JavaScriptCore)/jit \
-       $(JavaScriptCore)/builtins \
+    $(JavaScriptCore)/interpreter \
+    $(JavaScriptCore)/jit \
+    $(JavaScriptCore)/builtins \
+    $(JavaScriptCore)/wasm/js \
 #
 
 PYTHON = python
@@ -159,6 +160,18 @@ OBJECT_LUT_HEADERS = \
     StringPrototype.lut.h \
     SymbolConstructor.lut.h \
     SymbolPrototype.lut.h \
+    WebAssemblyCompileErrorConstructor.lut.h \
+    WebAssemblyCompileErrorPrototype.lut.h \
+    WebAssemblyInstanceConstructor.lut.h \
+    WebAssemblyInstancePrototype.lut.h \
+    WebAssemblyMemoryConstructor.lut.h \
+    WebAssemblyMemoryPrototype.lut.h \
+    WebAssemblyModuleConstructor.lut.h \
+    WebAssemblyModulePrototype.lut.h \
+    WebAssemblyRuntimeErrorConstructor.lut.h \
+    WebAssemblyRuntimeErrorPrototype.lut.h \
+    WebAssemblyTableConstructor.lut.h \
+    WebAssemblyTablePrototype.lut.h \
 #
 
 $(OBJECT_LUT_HEADERS): %.lut.h : %.cpp $(JavaScriptCore)/create_hash_table
index 07d514c..aecd1b2 100644 (file)
                A8A4748E151A8306004123FF /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; };
                AD2FCB881DAEBF3C00B3E736 /* WebAssemblyObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */; };
                AD2FCB891DAEBF3F00B3E736 /* WebAssemblyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */; };
+               AD2FCBE21DB58DAD00B3E736 /* JSWebAssemblyCompileError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */; };
+               AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */; };
+               AD2FCBE41DB58DAD00B3E736 /* JSWebAssemblyInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */; };
+               AD2FCBE51DB58DAD00B3E736 /* JSWebAssemblyInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBA91DB58DA400B3E736 /* JSWebAssemblyInstance.h */; };
+               AD2FCBE61DB58DAD00B3E736 /* JSWebAssemblyMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBAA1DB58DA400B3E736 /* JSWebAssemblyMemory.cpp */; };
+               AD2FCBE71DB58DAD00B3E736 /* JSWebAssemblyMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBAB1DB58DA400B3E736 /* JSWebAssemblyMemory.h */; };
+               AD2FCBE81DB58DAD00B3E736 /* JSWebAssemblyRuntimeError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBAC1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.cpp */; };
+               AD2FCBE91DB58DAD00B3E736 /* JSWebAssemblyRuntimeError.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBAD1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.h */; };
+               AD2FCBEA1DB58DAD00B3E736 /* JSWebAssemblyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBAE1DB58DA400B3E736 /* JSWebAssemblyTable.cpp */; };
+               AD2FCBEB1DB58DAD00B3E736 /* JSWebAssemblyTable.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBAF1DB58DA400B3E736 /* JSWebAssemblyTable.h */; };
+               AD2FCBEC1DB58DAD00B3E736 /* WebAssemblyCompileErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBB01DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.cpp */; };
+               AD2FCBED1DB58DAD00B3E736 /* WebAssemblyCompileErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBB11DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.h */; };
+               AD2FCBEE1DB58DAD00B3E736 /* WebAssemblyCompileErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBB21DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.cpp */; };
+               AD2FCBEF1DB58DAD00B3E736 /* WebAssemblyCompileErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBB31DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.h */; };
+               AD2FCBF01DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBB41DB58DA400B3E736 /* WebAssemblyInstanceConstructor.cpp */; };
+               AD2FCBF11DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */; };
+               AD2FCBF21DB58DAD00B3E736 /* WebAssemblyInstancePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBB61DB58DA400B3E736 /* WebAssemblyInstancePrototype.cpp */; };
+               AD2FCBF31DB58DAD00B3E736 /* WebAssemblyInstancePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBB71DB58DA400B3E736 /* WebAssemblyInstancePrototype.h */; };
+               AD2FCBF41DB58DAD00B3E736 /* WebAssemblyMemoryConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBB81DB58DA400B3E736 /* WebAssemblyMemoryConstructor.cpp */; };
+               AD2FCBF51DB58DAD00B3E736 /* WebAssemblyMemoryConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBB91DB58DA400B3E736 /* WebAssemblyMemoryConstructor.h */; };
+               AD2FCBF61DB58DAD00B3E736 /* WebAssemblyMemoryPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBBA1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.cpp */; };
+               AD2FCBF71DB58DAD00B3E736 /* WebAssemblyMemoryPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBBB1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.h */; };
+               AD2FCBF81DB58DAD00B3E736 /* WebAssemblyRuntimeErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBBC1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.cpp */; };
+               AD2FCBF91DB58DAD00B3E736 /* WebAssemblyRuntimeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBBD1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.h */; };
+               AD2FCBFA1DB58DAD00B3E736 /* WebAssemblyRuntimeErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBBE1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.cpp */; };
+               AD2FCBFB1DB58DAD00B3E736 /* WebAssemblyRuntimeErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBBF1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.h */; };
+               AD2FCBFC1DB58DAD00B3E736 /* WebAssemblyTableConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBC01DB58DA400B3E736 /* WebAssemblyTableConstructor.cpp */; };
+               AD2FCBFD1DB58DAD00B3E736 /* WebAssemblyTableConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBC11DB58DA400B3E736 /* WebAssemblyTableConstructor.h */; };
+               AD2FCBFE1DB58DAD00B3E736 /* WebAssemblyTablePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCBC21DB58DA400B3E736 /* WebAssemblyTablePrototype.cpp */; };
+               AD2FCBFF1DB58DAD00B3E736 /* WebAssemblyTablePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCBC31DB58DA400B3E736 /* WebAssemblyTablePrototype.h */; };
+               AD2FCC001DB58DAD00B3E736 /* WebAssemblyModuleConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCB981DB585A600B3E736 /* WebAssemblyModuleConstructor.cpp */; };
+               AD2FCC011DB58DAD00B3E736 /* WebAssemblyModuleConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCB991DB585A600B3E736 /* WebAssemblyModuleConstructor.h */; };
+               AD2FCC021DB58DAD00B3E736 /* WebAssemblyModulePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCB9A1DB585A600B3E736 /* WebAssemblyModulePrototype.cpp */; };
+               AD2FCC031DB58DAD00B3E736 /* WebAssemblyModulePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCB9B1DB585A600B3E736 /* WebAssemblyModulePrototype.h */; };
+               AD2FCC041DB58DAD00B3E736 /* JSWebAssemblyModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD2FCB8C1DB5844000B3E736 /* JSWebAssemblyModule.cpp */; };
+               AD2FCC051DB58DAD00B3E736 /* JSWebAssemblyModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCB8D1DB5844000B3E736 /* JSWebAssemblyModule.h */; };
+               AD2FCC161DB59CB200B3E736 /* WebAssemblyCompileErrorConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0A1DB59C5900B3E736 /* WebAssemblyCompileErrorConstructor.lut.h */; };
+               AD2FCC171DB59CB200B3E736 /* WebAssemblyCompileErrorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0B1DB59C5900B3E736 /* WebAssemblyCompileErrorPrototype.lut.h */; };
+               AD2FCC181DB59CB200B3E736 /* WebAssemblyInstanceConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0C1DB59C5900B3E736 /* WebAssemblyInstanceConstructor.lut.h */; };
+               AD2FCC191DB59CB200B3E736 /* WebAssemblyInstancePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0D1DB59C5900B3E736 /* WebAssemblyInstancePrototype.lut.h */; };
+               AD2FCC1A1DB59CB200B3E736 /* WebAssemblyMemoryConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0E1DB59C5900B3E736 /* WebAssemblyMemoryConstructor.lut.h */; };
+               AD2FCC1B1DB59CB200B3E736 /* WebAssemblyMemoryPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC0F1DB59C5900B3E736 /* WebAssemblyMemoryPrototype.lut.h */; };
+               AD2FCC1C1DB59CB200B3E736 /* WebAssemblyModuleConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC101DB59C5900B3E736 /* WebAssemblyModuleConstructor.lut.h */; };
+               AD2FCC1D1DB59CB200B3E736 /* WebAssemblyModulePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC111DB59C5900B3E736 /* WebAssemblyModulePrototype.lut.h */; };
+               AD2FCC1E1DB59CB200B3E736 /* WebAssemblyRuntimeErrorConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC121DB59C5900B3E736 /* WebAssemblyRuntimeErrorConstructor.lut.h */; };
+               AD2FCC1F1DB59CB200B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC131DB59C5900B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h */; };
+               AD2FCC201DB59CB200B3E736 /* WebAssemblyTableConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC141DB59C5900B3E736 /* WebAssemblyTableConstructor.lut.h */; };
+               AD2FCC211DB59CB200B3E736 /* WebAssemblyTablePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */; };
                AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ADDB1F6318D77DBE009B58A8 /* OpaqueRootSet.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; };
                AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyTable.cpp; sourceTree = "<group>"; };
                AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAssemblyObject.cpp; sourceTree = "<group>"; };
                AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyObject.h; sourceTree = "<group>"; };
+               AD2FCB8C1DB5844000B3E736 /* JSWebAssemblyModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyModule.cpp; path = js/JSWebAssemblyModule.cpp; sourceTree = "<group>"; };
+               AD2FCB8D1DB5844000B3E736 /* JSWebAssemblyModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyModule.h; path = js/JSWebAssemblyModule.h; sourceTree = "<group>"; };
+               AD2FCB981DB585A600B3E736 /* WebAssemblyModuleConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyModuleConstructor.cpp; path = js/WebAssemblyModuleConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCB991DB585A600B3E736 /* WebAssemblyModuleConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyModuleConstructor.h; path = js/WebAssemblyModuleConstructor.h; sourceTree = "<group>"; };
+               AD2FCB9A1DB585A600B3E736 /* WebAssemblyModulePrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyModulePrototype.cpp; path = js/WebAssemblyModulePrototype.cpp; sourceTree = "<group>"; };
+               AD2FCB9B1DB585A600B3E736 /* WebAssemblyModulePrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyModulePrototype.h; path = js/WebAssemblyModulePrototype.h; sourceTree = "<group>"; };
+               AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyCompileError.cpp; path = js/JSWebAssemblyCompileError.cpp; sourceTree = "<group>"; };
+               AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyCompileError.h; path = js/JSWebAssemblyCompileError.h; sourceTree = "<group>"; };
+               AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyInstance.cpp; path = js/JSWebAssemblyInstance.cpp; sourceTree = "<group>"; };
+               AD2FCBA91DB58DA400B3E736 /* JSWebAssemblyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyInstance.h; path = js/JSWebAssemblyInstance.h; sourceTree = "<group>"; };
+               AD2FCBAA1DB58DA400B3E736 /* JSWebAssemblyMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyMemory.cpp; path = js/JSWebAssemblyMemory.cpp; sourceTree = "<group>"; };
+               AD2FCBAB1DB58DA400B3E736 /* JSWebAssemblyMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyMemory.h; path = js/JSWebAssemblyMemory.h; sourceTree = "<group>"; };
+               AD2FCBAC1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyRuntimeError.cpp; path = js/JSWebAssemblyRuntimeError.cpp; sourceTree = "<group>"; };
+               AD2FCBAD1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyRuntimeError.h; path = js/JSWebAssemblyRuntimeError.h; sourceTree = "<group>"; };
+               AD2FCBAE1DB58DA400B3E736 /* JSWebAssemblyTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyTable.cpp; path = js/JSWebAssemblyTable.cpp; sourceTree = "<group>"; };
+               AD2FCBAF1DB58DA400B3E736 /* JSWebAssemblyTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyTable.h; path = js/JSWebAssemblyTable.h; sourceTree = "<group>"; };
+               AD2FCBB01DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyCompileErrorConstructor.cpp; path = js/WebAssemblyCompileErrorConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCBB11DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyCompileErrorConstructor.h; path = js/WebAssemblyCompileErrorConstructor.h; sourceTree = "<group>"; };
+               AD2FCBB21DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyCompileErrorPrototype.cpp; path = js/WebAssemblyCompileErrorPrototype.cpp; sourceTree = "<group>"; };
+               AD2FCBB31DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyCompileErrorPrototype.h; path = js/WebAssemblyCompileErrorPrototype.h; sourceTree = "<group>"; };
+               AD2FCBB41DB58DA400B3E736 /* WebAssemblyInstanceConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyInstanceConstructor.cpp; path = js/WebAssemblyInstanceConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyInstanceConstructor.h; path = js/WebAssemblyInstanceConstructor.h; sourceTree = "<group>"; };
+               AD2FCBB61DB58DA400B3E736 /* WebAssemblyInstancePrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyInstancePrototype.cpp; path = js/WebAssemblyInstancePrototype.cpp; sourceTree = "<group>"; };
+               AD2FCBB71DB58DA400B3E736 /* WebAssemblyInstancePrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyInstancePrototype.h; path = js/WebAssemblyInstancePrototype.h; sourceTree = "<group>"; };
+               AD2FCBB81DB58DA400B3E736 /* WebAssemblyMemoryConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyMemoryConstructor.cpp; path = js/WebAssemblyMemoryConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCBB91DB58DA400B3E736 /* WebAssemblyMemoryConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyMemoryConstructor.h; path = js/WebAssemblyMemoryConstructor.h; sourceTree = "<group>"; };
+               AD2FCBBA1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyMemoryPrototype.cpp; path = js/WebAssemblyMemoryPrototype.cpp; sourceTree = "<group>"; };
+               AD2FCBBB1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyMemoryPrototype.h; path = js/WebAssemblyMemoryPrototype.h; sourceTree = "<group>"; };
+               AD2FCBBC1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyRuntimeErrorConstructor.cpp; path = js/WebAssemblyRuntimeErrorConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCBBD1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyRuntimeErrorConstructor.h; path = js/WebAssemblyRuntimeErrorConstructor.h; sourceTree = "<group>"; };
+               AD2FCBBE1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyRuntimeErrorPrototype.cpp; path = js/WebAssemblyRuntimeErrorPrototype.cpp; sourceTree = "<group>"; };
+               AD2FCBBF1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyRuntimeErrorPrototype.h; path = js/WebAssemblyRuntimeErrorPrototype.h; sourceTree = "<group>"; };
+               AD2FCBC01DB58DA400B3E736 /* WebAssemblyTableConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyTableConstructor.cpp; path = js/WebAssemblyTableConstructor.cpp; sourceTree = "<group>"; };
+               AD2FCBC11DB58DA400B3E736 /* WebAssemblyTableConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyTableConstructor.h; path = js/WebAssemblyTableConstructor.h; sourceTree = "<group>"; };
+               AD2FCBC21DB58DA400B3E736 /* WebAssemblyTablePrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyTablePrototype.cpp; path = js/WebAssemblyTablePrototype.cpp; sourceTree = "<group>"; };
+               AD2FCBC31DB58DA400B3E736 /* WebAssemblyTablePrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyTablePrototype.h; path = js/WebAssemblyTablePrototype.h; sourceTree = "<group>"; };
+               AD2FCC0A1DB59C5900B3E736 /* WebAssemblyCompileErrorConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyCompileErrorConstructor.lut.h; sourceTree = SOURCE_ROOT; };
+               AD2FCC0B1DB59C5900B3E736 /* WebAssemblyCompileErrorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyCompileErrorPrototype.lut.h; sourceTree = "<group>"; };
+               AD2FCC0C1DB59C5900B3E736 /* WebAssemblyInstanceConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyInstanceConstructor.lut.h; sourceTree = "<group>"; };
+               AD2FCC0D1DB59C5900B3E736 /* WebAssemblyInstancePrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyInstancePrototype.lut.h; sourceTree = "<group>"; };
+               AD2FCC0E1DB59C5900B3E736 /* WebAssemblyMemoryConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyMemoryConstructor.lut.h; sourceTree = "<group>"; };
+               AD2FCC0F1DB59C5900B3E736 /* WebAssemblyMemoryPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyMemoryPrototype.lut.h; sourceTree = "<group>"; };
+               AD2FCC101DB59C5900B3E736 /* WebAssemblyModuleConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyModuleConstructor.lut.h; sourceTree = "<group>"; };
+               AD2FCC111DB59C5900B3E736 /* WebAssemblyModulePrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyModulePrototype.lut.h; sourceTree = "<group>"; };
+               AD2FCC121DB59C5900B3E736 /* WebAssemblyRuntimeErrorConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyRuntimeErrorConstructor.lut.h; sourceTree = "<group>"; };
+               AD2FCC131DB59C5900B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyRuntimeErrorPrototype.lut.h; sourceTree = "<group>"; };
+               AD2FCC141DB59C5900B3E736 /* WebAssemblyTableConstructor.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyTableConstructor.lut.h; sourceTree = "<group>"; };
+               AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAssemblyTablePrototype.lut.h; sourceTree = "<group>"; };
                AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMapInlines.h; sourceTree = "<group>"; };
                ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueRootSet.h; sourceTree = "<group>"; };
                B59F89371891AD3300D5CCDC /* UnlinkedInstructionStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedInstructionStream.h; sourceTree = "<group>"; };
                650FDF8D09D0FCA700769E54 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               AD2FCC0A1DB59C5900B3E736 /* WebAssemblyCompileErrorConstructor.lut.h */,
+                               AD2FCC0B1DB59C5900B3E736 /* WebAssemblyCompileErrorPrototype.lut.h */,
+                               AD2FCC0C1DB59C5900B3E736 /* WebAssemblyInstanceConstructor.lut.h */,
+                               AD2FCC0D1DB59C5900B3E736 /* WebAssemblyInstancePrototype.lut.h */,
+                               AD2FCC0E1DB59C5900B3E736 /* WebAssemblyMemoryConstructor.lut.h */,
+                               AD2FCC0F1DB59C5900B3E736 /* WebAssemblyMemoryPrototype.lut.h */,
+                               AD2FCC101DB59C5900B3E736 /* WebAssemblyModuleConstructor.lut.h */,
+                               AD2FCC111DB59C5900B3E736 /* WebAssemblyModulePrototype.lut.h */,
+                               AD2FCC121DB59C5900B3E736 /* WebAssemblyRuntimeErrorConstructor.lut.h */,
+                               AD2FCC131DB59C5900B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h */,
+                               AD2FCC141DB59C5900B3E736 /* WebAssemblyTableConstructor.lut.h */,
+                               AD2FCC151DB59C5900B3E736 /* WebAssemblyTablePrototype.lut.h */,
                                0F6183321C45F35C0072450B /* AirOpcode.h */,
                                0F6183341C45F3B60072450B /* AirOpcodeGenerated.h */,
                                0F6183351C45F3B60072450B /* AirOpcodeUtils.h */,
                7B98D1331B60CD1E0023B1A4 /* wasm */ = {
                        isa = PBXGroup;
                        children = (
+                               AD2FCB8A1DB5840000B3E736 /* js */,
                                AD2FCB861DAEBF3700B3E736 /* WebAssemblyObject.cpp */,
                                AD2FCB871DAEBF3700B3E736 /* WebAssemblyObject.h */,
                                7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */,
                        path = builtins;
                        sourceTree = "<group>";
                };
+               AD2FCB8A1DB5840000B3E736 /* js */ = {
+                       isa = PBXGroup;
+                       children = (
+                               AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */,
+                               AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */,
+                               AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */,
+                               AD2FCBA91DB58DA400B3E736 /* JSWebAssemblyInstance.h */,
+                               AD2FCBAA1DB58DA400B3E736 /* JSWebAssemblyMemory.cpp */,
+                               AD2FCBAB1DB58DA400B3E736 /* JSWebAssemblyMemory.h */,
+                               AD2FCBAC1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.cpp */,
+                               AD2FCBAD1DB58DA400B3E736 /* JSWebAssemblyRuntimeError.h */,
+                               AD2FCBAE1DB58DA400B3E736 /* JSWebAssemblyTable.cpp */,
+                               AD2FCBAF1DB58DA400B3E736 /* JSWebAssemblyTable.h */,
+                               AD2FCBB01DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.cpp */,
+                               AD2FCBB11DB58DA400B3E736 /* WebAssemblyCompileErrorConstructor.h */,
+                               AD2FCBB21DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.cpp */,
+                               AD2FCBB31DB58DA400B3E736 /* WebAssemblyCompileErrorPrototype.h */,
+                               AD2FCBB41DB58DA400B3E736 /* WebAssemblyInstanceConstructor.cpp */,
+                               AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */,
+                               AD2FCBB61DB58DA400B3E736 /* WebAssemblyInstancePrototype.cpp */,
+                               AD2FCBB71DB58DA400B3E736 /* WebAssemblyInstancePrototype.h */,
+                               AD2FCBB81DB58DA400B3E736 /* WebAssemblyMemoryConstructor.cpp */,
+                               AD2FCBB91DB58DA400B3E736 /* WebAssemblyMemoryConstructor.h */,
+                               AD2FCBBA1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.cpp */,
+                               AD2FCBBB1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.h */,
+                               AD2FCBBC1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.cpp */,
+                               AD2FCBBD1DB58DA400B3E736 /* WebAssemblyRuntimeErrorConstructor.h */,
+                               AD2FCBBE1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.cpp */,
+                               AD2FCBBF1DB58DA400B3E736 /* WebAssemblyRuntimeErrorPrototype.h */,
+                               AD2FCBC01DB58DA400B3E736 /* WebAssemblyTableConstructor.cpp */,
+                               AD2FCBC11DB58DA400B3E736 /* WebAssemblyTableConstructor.h */,
+                               AD2FCBC21DB58DA400B3E736 /* WebAssemblyTablePrototype.cpp */,
+                               AD2FCBC31DB58DA400B3E736 /* WebAssemblyTablePrototype.h */,
+                               AD2FCB981DB585A600B3E736 /* WebAssemblyModuleConstructor.cpp */,
+                               AD2FCB991DB585A600B3E736 /* WebAssemblyModuleConstructor.h */,
+                               AD2FCB9A1DB585A600B3E736 /* WebAssemblyModulePrototype.cpp */,
+                               AD2FCB9B1DB585A600B3E736 /* WebAssemblyModulePrototype.h */,
+                               AD2FCB8C1DB5844000B3E736 /* JSWebAssemblyModule.cpp */,
+                               AD2FCB8D1DB5844000B3E736 /* JSWebAssemblyModule.h */,
+                       );
+                       name = js;
+                       sourceTree = "<group>";
+               };
                C4703CC1192844A40013FBEA /* codegen */ = {
                        isa = PBXGroup;
                        children = (
                                BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */,
                                FE3A06BE1C11041200390FDD /* JITLeftShiftGenerator.h in Headers */,
                                BCF605140E203EF800B9A64D /* ArgList.h in Headers */,
+                               AD2FCC1E1DB59CB200B3E736 /* WebAssemblyRuntimeErrorConstructor.lut.h in Headers */,
                                DCEE22091CEB9895000C2396 /* DFGBackwardsCFG.h in Headers */,
                                0FE050141AA9091100D33B33 /* ArgumentsMode.h in Headers */,
                                0F6B1CB91861244C00845D97 /* ArityCheckMode.h in Headers */,
                                86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
                                65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */,
                                0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */,
+                               AD2FCC1B1DB59CB200B3E736 /* WebAssemblyMemoryPrototype.lut.h in Headers */,
                                A7A8AF3517ADB5F3005AB174 /* ArrayBuffer.h in Headers */,
                                0FFC99D5184EE318009C10AB /* ArrayBufferNeuteringWatchpoint.h in Headers */,
                                A7A8AF3717ADB5F3005AB174 /* ArrayBufferView.h in Headers */,
                                412952791D2CF6BC00E78B89 /* builtins_generate_wrapper_header.py in Headers */,
                                4129527A1D2CF6BC00E78B89 /* builtins_generate_wrapper_implementation.py in Headers */,
                                412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Headers */,
+                               AD2FCC011DB58DAD00B3E736 /* WebAssemblyModuleConstructor.h in Headers */,
                                FE3A06A61C10B72D00390FDD /* JITBitOrGenerator.h in Headers */,
                                99DA00A41BD5993100F4575C /* builtins_model.py in Headers */,
                                99DA00A51BD5993100F4575C /* builtins_templates.py in Headers */,
                                DCFDFBD91D1F5D9B00FE3D72 /* B3BottomProvider.h in Headers */,
                                0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
                                0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
+                               AD2FCBF11DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.h in Headers */,
                                C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
                                0F21C27F14BEAA8200ADC64B /* BytecodeConventions.h in Headers */,
                                969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
                                BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */,
                                0F6B8AD91C4EDDA200969052 /* B3DuplicateTails.h in Headers */,
                                0FE050261AA9095600D33B33 /* ClonedArguments.h in Headers */,
+                               AD2FCBFD1DB58DAD00B3E736 /* WebAssemblyTableConstructor.h in Headers */,
                                969A07970ED1D3AE00F1F681 /* CodeBlock.h in Headers */,
                                0F8F94411667633200D61971 /* CodeBlockHash.h in Headers */,
                                0FC97F34182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.h in Headers */,
                                0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */,
                                0FFB921816D02EB20055A5DB /* DFGAllocator.h in Headers */,
                                0F1E3A461534CBAF000F9456 /* DFGArgumentPosition.h in Headers */,
+                               AD2FCBF51DB58DAD00B3E736 /* WebAssemblyMemoryConstructor.h in Headers */,
                                0F7C5FB81D888A0C0044F5E2 /* MarkedBlockInlines.h in Headers */,
                                0F2DD8121AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h in Headers */,
                                0F2DD8141AB3D8BE00BBB8E8 /* DFGArgumentsUtilities.h in Headers */,
                                0F2BDC16151C5D4F00CD8910 /* DFGFixupPhase.h in Headers */,
                                0F9D339717FFC4E60073C2BC /* DFGFlushedAt.h in Headers */,
                                A7D89CF817A0B8CC00773AD8 /* DFGFlushFormat.h in Headers */,
+                               AD2FCC161DB59CB200B3E736 /* WebAssemblyCompileErrorConstructor.lut.h in Headers */,
                                0F2DD8151AB3D8BE00BBB8E8 /* DFGForAllKills.h in Headers */,
                                79A090801D768465008B889B /* HashMapImpl.h in Headers */,
                                0F69CC89193AC60A0045759E /* DFGFrozenValue.h in Headers */,
                                0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */,
                                0F2BDC461522802000CD8910 /* DFGMinifiedNode.h in Headers */,
                                0F8F14361ADF090100ED792C /* DFGMovHintRemovalPhase.h in Headers */,
+                               AD2FCBEF1DB58DAD00B3E736 /* WebAssemblyCompileErrorPrototype.h in Headers */,
                                0FF2CD5C1B61A4F8004955A8 /* DFGMultiGetByOffsetData.h in Headers */,
                                A737810E1799EA2E00817533 /* DFGNaturalLoops.h in Headers */,
                                86ECA3EA132DEF1C002B2AD7 /* DFGNode.h in Headers */,
                                86ECA3FA132DF25A002B2AD7 /* DFGScoreBoard.h in Headers */,
                                72AAF7CE1D0D31B3005E60BE /* JSCustomGetterSetterFunction.h in Headers */,
                                0F1E3A67153A21E2000F9456 /* DFGSilentRegisterSavePlan.h in Headers */,
+                               AD2FCC051DB58DAD00B3E736 /* JSWebAssemblyModule.h in Headers */,
                                0FFB921D16D02F300055A5DB /* DFGSlowPathGenerator.h in Headers */,
                                5341FC721DAC343C00E7E4D7 /* B3WasmBoundsCheckValue.h in Headers */,
                                86EC9DD31328DF82002B2AD7 /* DFGSpeculativeJIT.h in Headers */,
                                0FC20CB61852E2C600C9E954 /* DFGStrengthReductionPhase.h in Headers */,
                                0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */,
                                0F50AF3C193E8B3900674EE8 /* DFGStructureClobberState.h in Headers */,
+                               AD2FCC1A1DB59CB200B3E736 /* WebAssemblyMemoryConstructor.lut.h in Headers */,
                                FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */,
                                0F79085619A290B200F6310C /* DFGStructureRegistrationPhase.h in Headers */,
                                0F2FCCFF18A60070001A27F8 /* DFGThreadData.h in Headers */,
                                0FE050181AA9091100D33B33 /* DirectArguments.h in Headers */,
                                0FE050161AA9091100D33B33 /* DirectArgumentsOffset.h in Headers */,
                                0FF42731158EBD54004CB9FF /* Disassembler.h in Headers */,
+                               AD2FCBE71DB58DAD00B3E736 /* JSWebAssemblyMemory.h in Headers */,
                                A70447EE17A0BD7000F5898E /* DumpContext.h in Headers */,
                                2A83638618D7D0EE0000EBCC /* EdenGCActivityCallback.h in Headers */,
                                99E45A2418A1B2590026D88F /* EmptyInputCursor.h in Headers */,
                                DE26E9031CB5DD0500D2BE82 /* BuiltinExecutableCreator.h in Headers */,
                                0FB105861675481200F8AB6E /* ExitKind.h in Headers */,
                                0F0B83AB14BCF5BB00885B4F /* ExpressionRangeInfo.h in Headers */,
+                               AD2FCBFB1DB58DAD00B3E736 /* WebAssemblyRuntimeErrorPrototype.h in Headers */,
                                0F4DE1CF1C4C1B54004D6C11 /* AirFixObviousSpills.h in Headers */,
                                A7A8AF3817ADB5F3005AB174 /* Float32Array.h in Headers */,
                                A7A8AF3917ADB5F3005AB174 /* Float64Array.h in Headers */,
                                0FEA0A231709606900BB722C /* FTLCommonValues.h in Headers */,
                                0FEA0A0C170513DB00BB722C /* FTLCompile.h in Headers */,
                                0F235BD417178E1C00690C7F /* FTLExitArgument.h in Headers */,
+                               AD2FCBF91DB58DAD00B3E736 /* WebAssemblyRuntimeErrorConstructor.h in Headers */,
                                0F338E0C1BF0276C0013C88F /* B3Compilation.h in Headers */,
                                0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */,
                                0F235BD717178E1C00690C7F /* FTLStackmapArgumentList.h in Headers */,
                                0F9332A014CA7DCD0085F3C6 /* GetByIdStatus.h in Headers */,
                                0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */,
                                7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */,
+                               AD2FCC1C1DB59CB200B3E736 /* WebAssemblyModuleConstructor.lut.h in Headers */,
                                0F24E54417EA9F5900ABB217 /* GPRInfo.h in Headers */,
                                142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
                                C283190016FE4B7D00157BFD /* HandleBlock.h in Headers */,
                                FE187A0D1C030D5C0038BBCA /* JITDivGenerator.h in Headers */,
                                2AD8932B17E3868F00668276 /* HeapIterationScope.h in Headers */,
                                A5339EC91BB4B4600054F005 /* HeapObserver.h in Headers */,
+                               AD2FCBEB1DB58DAD00B3E736 /* JSWebAssemblyTable.h in Headers */,
                                2A6F462617E959CE00C45C98 /* HeapOperation.h in Headers */,
                                14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */,
                                C24D31E3161CD695002AA4DB /* HeapStatistics.h in Headers */,
                                BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
                                BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
                                1429D9300ED22D7000B89619 /* JIT.h in Headers */,
+                               AD2FCBE91DB58DAD00B3E736 /* JSWebAssemblyRuntimeError.h in Headers */,
                                86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
                                0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
                                0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
                                0F766D3115AA8112008F363E /* JITStubRoutine.h in Headers */,
                                0F766D2C15A8CC3A008F363E /* JITStubRoutineSet.h in Headers */,
                                0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */,
+                               AD2FCC211DB59CB200B3E736 /* WebAssemblyTablePrototype.lut.h in Headers */,
                                0FC712E317CD8793008CC93C /* JITToDFGDeferredCompilationCallback.h in Headers */,
+                               AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */,
                                840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
                                C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */,
                                BC18C4170E16F5CD00B34460 /* JSArray.h in Headers */,
                                BC18C41E0E16F5CD00B34460 /* JSContextRef.h in Headers */,
                                A5EA70EE19F5B5C40098F5EC /* JSContextRefInspectorSupport.h in Headers */,
                                A5D2E665195E174000A518E7 /* JSContextRefInternal.h in Headers */,
+                               AD2FCC031DB58DAD00B3E736 /* WebAssemblyModulePrototype.h in Headers */,
                                A5AB49DD1BEC8086007020FB /* PerGlobalObjectWrapperWorld.h in Headers */,
                                148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */,
                                A72028B81797601E0098028C /* JSCTestRunnerUtils.h in Headers */,
                                7013CA8C1B491A9400CAE613 /* JSJob.h in Headers */,
                                BC18C4160E16F5CD00B34460 /* JSLexicalEnvironment.h in Headers */,
                                BC18C4230E16F5CD00B34460 /* JSLock.h in Headers */,
+                               AD2FCC191DB59CB200B3E736 /* WebAssemblyInstancePrototype.lut.h in Headers */,
                                C25D709C16DE99F400FCA6BC /* JSManagedValue.h in Headers */,
                                2A4BB7F318A41179008A0FCD /* JSManagedValueInternal.h in Headers */,
                                A700874217CBE8EB00C3E643 /* JSMap.h in Headers */,
                                9959E92D1BD17FA4001AA413 /* jsmin.py in Headers */,
                                E3D239C91B829C1C00BBEF67 /* JSModuleEnvironment.h in Headers */,
                                E318CBC11B8AEF5100A2929D /* JSModuleNamespaceObject.h in Headers */,
+                               AD2FCC171DB59CB200B3E736 /* WebAssemblyCompileErrorPrototype.lut.h in Headers */,
                                E39DA4A71B7E8B7C0084F33A /* JSModuleRecord.h in Headers */,
                                E33E8D1D1B9013C300346B52 /* JSNativeStdFunction.h in Headers */,
                                BC18C4240E16F5CD00B34460 /* JSObject.h in Headers */,
                                E322E5A31DA64439006E7709 /* DFGDOMJITPatchpointParams.h in Headers */,
                                E3EF88751B66DF23003F26CB /* JSPropertyNameIterator.h in Headers */,
                                862553D216136E1A009F17D0 /* JSProxy.h in Headers */,
+                               AD2FCC1F1DB59CB200B3E736 /* WebAssemblyRuntimeErrorPrototype.lut.h in Headers */,
                                A552C3801ADDB8FE00139726 /* JSRemoteInspector.h in Headers */,
                                9928FF3C18AC4AEC00B8CF12 /* JSReplayInputs.h in Headers */,
                                BC18C4260E16F5CD00B34460 /* JSRetainPtr.h in Headers */,
                                2600B5A7152BAAA70091EE5F /* JSStringJoiner.h in Headers */,
                                BC18C4280E16F5CD00B34460 /* JSStringRef.h in Headers */,
                                43AB26C61C1A535900D82AE6 /* B3MathExtras.h in Headers */,
+                               AD2FCBF31DB58DAD00B3E736 /* WebAssemblyInstancePrototype.h in Headers */,
                                BC18C4290E16F5CD00B34460 /* JSStringRefCF.h in Headers */,
                                1A28D4A8177B71C80007FA3C /* JSStringRefPrivate.h in Headers */,
                                0F919D0D157EE0A2004A4E7D /* JSSymbolTableObject.h in Headers */,
                                A77F1825164192C700640A47 /* ParserModes.h in Headers */,
                                E328C6C91DA432F900D255FD /* RegisterAtOffset.h in Headers */,
                                65303D641447B9E100D3F904 /* ParserTokens.h in Headers */,
+                               AD2FCC1D1DB59CB200B3E736 /* WebAssemblyModulePrototype.lut.h in Headers */,
                                0FF9CE741B9CD6D0004EDCA6 /* PolymorphicAccess.h in Headers */,
                                0FE834181A6EF97B00D04847 /* PolymorphicCallStubRoutine.h in Headers */,
                                0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
                                FE318FE01CAC982F00DFCC54 /* ECMAScriptSpecInternalFunctions.h in Headers */,
                                0FE050291AA9095600D33B33 /* ScopedArgumentsTable.h in Headers */,
                                0FE0502B1AA9095600D33B33 /* ScopeOffset.h in Headers */,
+                               AD2FCBF71DB58DAD00B3E736 /* WebAssemblyMemoryPrototype.h in Headers */,
                                0F24E55217EE274900ABB217 /* ScratchRegisterAllocator.h in Headers */,
                                A5FD0068189AFE9C00633231 /* ScriptArguments.h in Headers */,
                                A503FA21188EFF6800110F14 /* ScriptBreakpoint.h in Headers */,
                                A790DD6E182F499700588807 /* SetIteratorPrototype.h in Headers */,
                                A7299DA217D12848005F5FF9 /* SetPrototype.h in Headers */,
                                0FEE98411A8865B700754E93 /* SetupVarargsFrame.h in Headers */,
+                               AD2FCC181DB59CB200B3E736 /* WebAssemblyInstanceConstructor.lut.h in Headers */,
                                86AE64AA135E5E1C00963012 /* SH4Assembler.h in Headers */,
                                0F2B670517B6B5AB00A7AE3F /* SimpleTypedArrayController.h in Headers */,
                                14BA78F113AAB88F005B7C2C /* SlotVisitor.h in Headers */,
                                E32FF1EA1DA7571C00A8BF21 /* DOMJITSlowPathCalls.h in Headers */,
                                53FD04D41D7AB291003287D3 /* WASMCallingConvention.h in Headers */,
                                705B41B21A6E501E00716757 /* SymbolPrototype.h in Headers */,
+                               AD2FCC201DB59CB200B3E736 /* WebAssemblyTableConstructor.lut.h in Headers */,
                                996B73281BDA08EF00331B84 /* SymbolPrototype.lut.h in Headers */,
                                BC18C46B0E16F5CD00B34460 /* SymbolTable.h in Headers */,
                                A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
                                70ECA6081AFDBEA200449739 /* TemplateRegistry.h in Headers */,
+                               AD2FCBED1DB58DAD00B3E736 /* WebAssemblyCompileErrorConstructor.h in Headers */,
                                0F5B4A331C84F0D600F1B17E /* SlowPathReturnType.h in Headers */,
                                70ECA6091AFDBEA200449739 /* TemplateRegistryKey.h in Headers */,
                                0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
                                FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
                                0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */,
                                142E313C134FF0A600AFADB5 /* Weak.h in Headers */,
+                               AD2FCBE51DB58DAD00B3E736 /* JSWebAssemblyInstance.h in Headers */,
                                14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */,
                                14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */,
                                AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */,
                                79B1788E1D399B8000B1A567 /* JITMathICForwards.h in Headers */,
                                451539B912DC994500EF7AC4 /* Yarr.h in Headers */,
                                E37AD83C1DA4928600F3D412 /* DOMJITPatchpointParams.h in Headers */,
+                               AD2FCBFF1DB58DAD00B3E736 /* WebAssemblyTablePrototype.h in Headers */,
                                86704B8512DBA33700A9FE7B /* YarrInterpreter.h in Headers */,
                                86704B8712DBA33700A9FE7B /* YarrJIT.h in Headers */,
                                0FB4767F1D99AEAD008EA6CB /* GCDeferralContextInlines.h in Headers */,
                                14280863107EC11A0013E7B2 /* BooleanConstructor.cpp in Sources */,
                                14280864107EC11A0013E7B2 /* BooleanObject.cpp in Sources */,
                                14280865107EC11A0013E7B2 /* BooleanPrototype.cpp in Sources */,
+                               AD2FCBF61DB58DAD00B3E736 /* WebAssemblyMemoryPrototype.cpp in Sources */,
                                A7D801A41880D66E0026C39B /* BuiltinExecutables.cpp in Sources */,
                                9EA5C7A1190F084200508EBE /* BundlePath.mm in Sources */,
                                C2FCAE1017A9C24E0034C735 /* BytecodeBasicBlock.cpp in Sources */,
                                62D755D41B84FB3D001801FA /* CallFrameShuffler64.cpp in Sources */,
                                0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */,
                                0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */,
+                               AD2FCBFE1DB58DAD00B3E736 /* WebAssemblyTablePrototype.cpp in Sources */,
                                0F6B8ADC1C4EFAC300969052 /* B3SSACalculator.cpp in Sources */,
                                627673231B680C1E00FD9F2E /* CallMode.cpp in Sources */,
                                0F3B7E2A19A11B8000D9BC56 /* CallVariant.cpp in Sources */,
                                C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */,
                                0FE8534B1723CDA500B618F5 /* DFGDesiredWatchpoints.cpp in Sources */,
                                C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */,
+                               AD2FCBE81DB58DAD00B3E736 /* JSWebAssemblyRuntimeError.cpp in Sources */,
                                0FF427641591A1CC004CB9FF /* DFGDisassembler.cpp in Sources */,
                                0F5A1273192D9FDF008764A3 /* DFGDoesGC.cpp in Sources */,
                                0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
                                0F2B9CEC19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.cpp in Sources */,
                                0FB17662196B8F9E0091052A /* DFGPureValue.cpp in Sources */,
                                0F3A1BF91A9ECB7D000DE01A /* DFGPutStackSinkingPhase.cpp in Sources */,
+                               AD2FCBEA1DB58DAD00B3E736 /* JSWebAssemblyTable.cpp in Sources */,
                                0F2FCCFB18A60070001A27F8 /* DFGSafepoint.cpp in Sources */,
                                86EC9DD21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp in Sources */,
                                86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
                                0F682FB219BCB36400FA3BAD /* DFGSSACalculator.cpp in Sources */,
                                A7D89CFF17A0B8CC00773AD8 /* DFGSSAConversionPhase.cpp in Sources */,
                                0FC20CB918556A3500C9E954 /* DFGSSALoweringPhase.cpp in Sources */,
+                               AD2FCBF01DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.cpp in Sources */,
                                0F9FB4F417FCB91700CB67F8 /* DFGStackLayoutPhase.cpp in Sources */,
                                0F4F29DF18B6AD1C0057BC15 /* DFGStaticExecutionCountEstimationPhase.cpp in Sources */,
                                0F9E32631B05AB0400801ED5 /* DFGStoreBarrierInsertionPhase.cpp in Sources */,
                                0FDDBFB51666EED800C55FEF /* DFGVariableAccessDataDump.cpp in Sources */,
                                0F9495871C57F47500413A48 /* B3StackSlot.cpp in Sources */,
                                0F2BDC5115228FFD00CD8910 /* DFGVariableEvent.cpp in Sources */,
+                               AD2FCBF21DB58DAD00B3E736 /* WebAssemblyInstancePrototype.cpp in Sources */,
                                0F2BDC4A1522809A00CD8910 /* DFGVariableEventStream.cpp in Sources */,
                                0FFFC95F14EF90BB00C72532 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */,
                                0FC97F4118202119002C9B26 /* DFGWatchpointCollectionPhase.cpp in Sources */,
                                99E45A2518A1B2590026D88F /* EncodedValue.cpp in Sources */,
                                147F39C7107EC37600427A48 /* Error.cpp in Sources */,
                                147F39C8107EC37600427A48 /* ErrorConstructor.cpp in Sources */,
+                               AD2FCBEC1DB58DAD00B3E736 /* WebAssemblyCompileErrorConstructor.cpp in Sources */,
                                FEB58C14187B8B160098EF0B /* ErrorHandlingScope.cpp in Sources */,
                                147F39C9107EC37600427A48 /* ErrorInstance.cpp in Sources */,
                                147F39CA107EC37600427A48 /* ErrorPrototype.cpp in Sources */,
                                A1B9E23D1B4E0D6700BC7FED /* IntlCollatorPrototype.cpp in Sources */,
                                A1587D6D1B4DC14100D69849 /* IntlDateTimeFormat.cpp in Sources */,
                                A1587D6F1B4DC14100D69849 /* IntlDateTimeFormatConstructor.cpp in Sources */,
+                               AD2FCC041DB58DAD00B3E736 /* JSWebAssemblyModule.cpp in Sources */,
                                FE3A06BF1C11041600390FDD /* JITRightShiftGenerator.cpp in Sources */,
                                262D85B61C0D650F006ACB61 /* AirFixPartialRegisterStalls.cpp in Sources */,
                                E322E5A61DA644A8006E7709 /* FTLDOMJITPatchpointParams.cpp in Sources */,
                                0F8F94441667635400D61971 /* JITCode.cpp in Sources */,
                                0FAF7EFD165BA91B000C8455 /* JITDisassembler.cpp in Sources */,
                                0F6DB7EC1D617D1100CDBF8E /* MacroAssemblerCodeRef.cpp in Sources */,
+                               AD2FCBE21DB58DAD00B3E736 /* JSWebAssemblyCompileError.cpp in Sources */,
                                0F46808314BA573100BFE272 /* JITExceptions.cpp in Sources */,
                                0FB14E1E18124ACE009B6B4D /* JITInlineCacheGenerator.cpp in Sources */,
                                BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */,
                                14ABDF600A437FEF00ECCA01 /* JSCallbackObject.cpp in Sources */,
                                657CF45819BF6662004ACBF2 /* JSCallee.cpp in Sources */,
                                A7D801A81880D6A80026C39B /* JSCBuiltins.cpp in Sources */,
+                               AD2FCC001DB58DAD00B3E736 /* WebAssemblyModuleConstructor.cpp in Sources */,
                                147F39D1107EC37600427A48 /* JSCell.cpp in Sources */,
                                147F39D6107EC37600427A48 /* JSCJSValue.cpp in Sources */,
                                1440FCE40A51E46B0005F061 /* JSClassRef.cpp in Sources */,
                                7013CA8B1B491A9400CAE613 /* JSJob.cpp in Sources */,
                                140B7D1D0DC69AF7009C42B8 /* JSLexicalEnvironment.cpp in Sources */,
                                14280875107EC13E0013E7B2 /* JSLock.cpp in Sources */,
+                               AD2FCBFA1DB58DAD00B3E736 /* WebAssemblyRuntimeErrorPrototype.cpp in Sources */,
                                C25D709B16DE99F400FCA6BC /* JSManagedValue.mm in Sources */,
                                A700874117CBE8EB00C3E643 /* JSMap.cpp in Sources */,
                                A74DEF95182D991400522C22 /* JSMapIterator.cpp in Sources */,
                                E39DA4A61B7E8B7C0084F33A /* JSModuleRecord.cpp in Sources */,
                                0FB387921BFD31A100E3AB1E /* FTLCompile.cpp in Sources */,
                                E33E8D1C1B9013C300346B52 /* JSNativeStdFunction.cpp in Sources */,
+                               AD2FCBF81DB58DAD00B3E736 /* WebAssemblyRuntimeErrorConstructor.cpp in Sources */,
                                147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
                                1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */,
                                A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
                                FE68C6381B90DE0B0042BCB3 /* MacroAssemblerPrinter.cpp in Sources */,
                                A7A4AE0817973B26005612B1 /* MacroAssemblerX86Common.cpp in Sources */,
                                FE3A06AC1C10C39E00390FDD /* JITBitOrGenerator.cpp in Sources */,
+                               AD2FCBFC1DB58DAD00B3E736 /* WebAssemblyTableConstructor.cpp in Sources */,
                                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */,
                                A74DEF93182D991400522C22 /* MapIteratorPrototype.cpp in Sources */,
                                A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */,
                                0F190CAC189D82F6000AE5F0 /* ProfilerJettisonReason.cpp in Sources */,
                                0FF729B3166AD35C000F5BA3 /* ProfilerOrigin.cpp in Sources */,
                                0FF729B4166AD35C000F5BA3 /* ProfilerOriginStack.cpp in Sources */,
+                               AD2FCBE61DB58DAD00B3E736 /* JSWebAssemblyMemory.cpp in Sources */,
                                0F9D4C0C1C3E1C11006CD984 /* FTLExceptionTarget.cpp in Sources */,
                                0FB1058B1675483100F8AB6E /* ProfilerOSRExit.cpp in Sources */,
                                0FB1058D1675483700F8AB6E /* ProfilerOSRExitSite.cpp in Sources */,
                                A594558F18245EFD00CC3843 /* RemoteInspectionTarget.cpp in Sources */,
                                A5BA15EC182340B400A82E69 /* RemoteConnectionToTarget.mm in Sources */,
                                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */,
+                               AD2FCBF41DB58DAD00B3E736 /* WebAssemblyMemoryConstructor.cpp in Sources */,
                                0F24E55017EE274900ABB217 /* Repatch.cpp in Sources */,
                                0F6B8AD81C4EDDA200969052 /* B3DuplicateTails.cpp in Sources */,
                                527773DE1AAF83AC00BDE7E8 /* RuntimeType.cpp in Sources */,
                                0FF4274D158EBFE6004CB9FF /* udis86_itab_holder.c in Sources */,
                                0FF42745158EBE91004CB9FF /* udis86_syn-att.c in Sources */,
                                0FF42746158EBE91004CB9FF /* udis86_syn-intel.c in Sources */,
+                               AD2FCBEE1DB58DAD00B3E736 /* WebAssemblyCompileErrorPrototype.cpp in Sources */,
                                0FF42747158EBE91004CB9FF /* udis86_syn.c in Sources */,
                                70B791961C024A28002481E2 /* GeneratorFunctionPrototype.cpp in Sources */,
+                               AD2FCBE41DB58DAD00B3E736 /* JSWebAssemblyInstance.cpp in Sources */,
                                0FF42732158EBD58004CB9FF /* UDis86Disassembler.cpp in Sources */,
                                A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */,
                                14142E551B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp in Sources */,
                                0FE0502C1AA9095600D33B33 /* VarOffset.cpp in Sources */,
                                0F20C2591A8013AB00DA3229 /* VirtualRegister.cpp in Sources */,
                                E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */,
+                               AD2FCC021DB58DAD00B3E736 /* WebAssemblyModulePrototype.cpp in Sources */,
                                FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */,
                                FE187A011BFBE55E0038BBCA /* JITMulGenerator.cpp in Sources */,
                                53F40E8F1D5902820099A1B6 /* WASMB3IRGenerator.cpp in Sources */,
index 604c0bf..15a9410 100644 (file)
@@ -823,12 +823,9 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct
         auto* wasm = WebAssemblyObject::create(vm, this, WebAssemblyObject::createStructure(vm, this, m_objectPrototype.get()));
         putDirectWithoutTransition(vm, Identifier::fromString(exec, "WebAssembly"), wasm, DontEnum);
         GlobalPropertyInfo extraStaticGlobals[] = {
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().ModulePrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "Module")), DontEnum | DontDelete | ReadOnly),
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().InstancePrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "Instance")), DontEnum | DontDelete | ReadOnly),
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().MemoryPrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "Memory")), DontEnum | DontDelete | ReadOnly),
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().TablePrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "Table")), DontEnum | DontDelete | ReadOnly),
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().CompileErrorPrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "CompileError")), DontEnum | DontDelete | ReadOnly),
-            GlobalPropertyInfo(vm.propertyNames->builtinNames().RuntimeErrorPrivateName(), wasm->getDirect(vm, Identifier::fromString(exec, "RuntimeError")), DontEnum | DontDelete | ReadOnly),
+#define REGISTER_WASM_CONSTRUCTOR_AS_GLOBAL_PROPERTY(NAME, ...) \
+            GlobalPropertyInfo(vm.propertyNames->builtinNames().NAME ## PrivateName(), wasm->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));
     }
index 44c229b..9372fb4 100644 (file)
 #include "config.h"
 #include "WebAssemblyObject.h"
 
-#include "BuiltinNames.h"
 #include "FunctionPrototype.h"
-#include "InternalFunction.h"
 #include "JSCInlines.h"
-#include "JSDestructibleObject.h"
+#include "js/JSWebAssemblyCompileError.h"
+#include "js/JSWebAssemblyInstance.h"
+#include "js/JSWebAssemblyMemory.h"
+#include "js/JSWebAssemblyModule.h"
+#include "js/JSWebAssemblyRuntimeError.h"
+#include "js/JSWebAssemblyTable.h"
+#include "js/WebAssemblyCompileErrorConstructor.h"
+#include "js/WebAssemblyCompileErrorPrototype.h"
+#include "js/WebAssemblyInstanceConstructor.h"
+#include "js/WebAssemblyInstancePrototype.h"
+#include "js/WebAssemblyMemoryConstructor.h"
+#include "js/WebAssemblyMemoryPrototype.h"
+#include "js/WebAssemblyModuleConstructor.h"
+#include "js/WebAssemblyModulePrototype.h"
+#include "js/WebAssemblyRuntimeErrorConstructor.h"
+#include "js/WebAssemblyRuntimeErrorPrototype.h"
+#include "js/WebAssemblyTableConstructor.h"
+#include "js/WebAssemblyTablePrototype.h"
 
 namespace JSC {
 
 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(WebAssemblyObject);
 
-// 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)
-
-// FIXME Implement each of these in their own header file, and autogenerate *.lut.h files for *PrototypeTable. https://bugs.webkit.org/show_bug.cgi?id=161709
-#define DEFINE_WASM_OBJECT_CONSTRUCTOR_PROPERTY(NAME, functionLength) \
-    class JSWebAssembly ## NAME : public JSDestructibleObject { \
-    public: \
-        typedef JSDestructibleObject Base; \
-        \
-        static JSWebAssembly ## NAME* create(VM& vm, Structure* structure) \
-        { \
-            auto* format = new (NotNull, allocateCell<JSWebAssembly ## NAME>(vm.heap)) JSWebAssembly ## NAME(vm, structure); \
-            format->finishCreation(vm); \
-            return format; \
-        } \
-        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) \
-        { \
-            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); \
-        } \
-        \
-        DECLARE_INFO; \
-        \
-    protected: \
-        JSWebAssembly ## NAME(VM& vm, Structure* structure) \
-            : JSDestructibleObject(vm, structure) \
-        { \
-        } \
-        void finishCreation(VM& vm) \
-        { \
-            Base::finishCreation(vm); \
-            ASSERT(inherits(info())); \
-        } \
-    }; \
-    const ClassInfo JSWebAssembly ## NAME::s_info = { "WebAssembly." #NAME, &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssembly ## NAME) }; \
-    \
-    class WebAssembly ## NAME ## Prototype : public JSDestructibleObject { \
-    public: \
-        typedef JSDestructibleObject Base; \
-        static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; \
-        \
-        static WebAssembly ## NAME ## Prototype* create(VM& vm, JSGlobalObject*, Structure* structure) \
-        { \
-            auto* object = new (NotNull, allocateCell<WebAssembly ## NAME ## Prototype>(vm.heap)) WebAssembly ## NAME ## Prototype(vm, structure); \
-            object->finishCreation(vm); \
-            return object; \
-        } \
-        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) \
-        { \
-            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); \
-        } \
-        \
-        DECLARE_INFO; \
-        \
-    protected: \
-        void finishCreation(VM& vm) \
-        { \
-            Base::finishCreation(vm); \
-        } \
-        \
-    private: \
-        WebAssembly ## NAME ## Prototype(VM& vm, Structure* structure) \
-            : JSDestructibleObject(vm, structure) \
-        { \
-        } \
-    }; \
-    static const struct CompactHashIndex NAME ## PrototypeTableIndex[] = { { 0, 0 } }; \
-    static const struct HashTableValue NAME ## PrototypeTableValues[] = { { nullptr, 0, NoIntrinsic, { 0 } } }; \
-    static const struct HashTable NAME ## PrototypeTable = { 0, 0, true, NAME ## PrototypeTableValues, NAME ## PrototypeTableIndex }; \
-    const ClassInfo WebAssembly ## NAME ## Prototype::s_info = { "WebAssembly." #NAME ".prototype", &Base::s_info, &NAME ## PrototypeTable, CREATE_METHOD_TABLE(WebAssembly ## NAME ## Prototype) }; \
-    \
-    static EncodedJSValue JSC_HOST_CALL constructJSWebAssembly ## NAME(ExecState* state) \
-    { \
-        VM& vm = state->vm(); \
-        auto scope = DECLARE_THROW_SCOPE(vm); \
-        return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the " #NAME " constructor property")))); \
-    } \
-    \
-    static EncodedJSValue JSC_HOST_CALL callJSWebAssembly ## NAME(ExecState* state) \
-    { \
-    VM& vm = state->vm(); \
-    auto scope = DECLARE_THROW_SCOPE(vm); \
-    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the " #NAME " constructor property")))); \
-    } \
-    \
-    class WebAssembly ## NAME ## Constructor : public InternalFunction { \
-    public: \
-        typedef InternalFunction Base; \
-        static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; \
-        \
-        static WebAssembly ## NAME ## Constructor* create(VM& vm, Structure* structure, WebAssembly ## NAME ## Prototype* NAME ## Prototype, Structure* NAME ## Structure) \
-        { \
-            WebAssembly ## NAME ## Constructor* constructor = new (NotNull, allocateCell<WebAssembly ## NAME ## Constructor>(vm.heap)) WebAssembly ## NAME ## Constructor(vm, structure); \
-            constructor->finishCreation(vm, NAME ## Prototype, NAME ## Structure); \
-            return constructor; \
-        } \
-        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) \
-        { \
-            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); \
-        } \
-        \
-        DECLARE_INFO; \
-        \
-        Structure* NAME ## Structure() const { return m_ ## NAME ## Structure.get(); } \
-        \
-    protected: \
-        void finishCreation(VM& vm, WebAssembly ## NAME ## Prototype* NAME ## Prototype, Structure* NAME ## Structure) \
-        { \
-            Base::finishCreation(vm, ASCIILiteral(#NAME)); \
-            putDirectWithoutTransition(vm, vm.propertyNames->prototype, NAME ## Prototype, DontEnum | DontDelete | ReadOnly); \
-            putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(functionLength), ReadOnly | DontEnum | DontDelete); \
-            m_ ## NAME ## Structure.set(vm, this, NAME ## Structure); \
-        } \
-        \
-    private: \
-        WebAssembly ## NAME ## Constructor(VM& vm, Structure* structure) \
-            : InternalFunction(vm, structure) \
-        { \
-        } \
-        static ConstructType getConstructData(JSCell*, ConstructData& constructData) \
-        { \
-            constructData.native.function = constructJSWebAssembly ## NAME; \
-            return ConstructType::Host; \
-        } \
-        static CallType getCallData(JSCell*, CallData& callData) \
-        { \
-            callData.native.function = callJSWebAssembly ## NAME; \
-            return CallType::Host; \
-        } \
-        static void visitChildren(JSCell* cell, SlotVisitor& visitor) \
-        { \
-            auto* thisObject = jsCast<WebAssembly ## NAME ## Constructor*>(cell); \
-            ASSERT_GC_OBJECT_INHERITS(thisObject, info()); \
-            Base::visitChildren(thisObject, visitor); \
-            visitor.append(&thisObject->m_ ## NAME ## Structure); \
-        } \
-        \
-        WriteBarrier<Structure> m_ ## NAME ## Structure; \
-    }; \
-    static const struct CompactHashIndex NAME ## ConstructorTableIndex[] = { { 0, 0 } }; \
-    static const struct HashTableValue NAME ## ConstructorTableValues[] = { { nullptr, 0, NoIntrinsic, { 0 } } }; \
-    static const struct HashTable NAME ## ConstructorTable = { 0, 0, true, NAME ## ConstructorTableValues, NAME ## ConstructorTableIndex }; \
-    const ClassInfo WebAssembly ## NAME ## Constructor::s_info = { "Function", &Base::s_info, &NAME ## ConstructorTable, CREATE_METHOD_TABLE(WebAssembly ## NAME ## Constructor) };
-
-FOR_EACH_WASM_CONSTRUCTOR_PROPERTY(DEFINE_WASM_OBJECT_CONSTRUCTOR_PROPERTY)
-
-
 #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 = { "WebAssembly", &Base::s_info, 0, CREATE_METHOD_TABLE(WebAssemblyObject) };
 
 WebAssemblyObject* WebAssemblyObject::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
@@ -237,9 +94,6 @@ WebAssemblyObject::WebAssemblyObject(VM& vm, Structure* structure)
 {
 }
 
-// ------------------------------ Constructors -----------------------------
-
-    
 // ------------------------------ Functions --------------------------------
 
 EncodedJSValue JSC_HOST_CALL wasmObjectFuncvalidate(ExecState* state)
index 5596341..7b52ca6 100644 (file)
@@ -45,4 +45,18 @@ private:
     WebAssemblyObject(VM&, 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
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.cpp
new file mode 100644 (file)
index 0000000..32e136a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyCompileError.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyCompileError* JSWebAssemblyCompileError::create(ExecState* state, Structure* structure, const String& message, bool useCurrentFrame)
+{
+    auto& vm = state->vm();
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyCompileError>(vm.heap)) JSWebAssemblyCompileError(vm, structure);
+    instance->finishCreation(state, vm, message, useCurrentFrame);
+    return instance;
+}
+
+JSWebAssemblyCompileError::JSWebAssemblyCompileError(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+const ClassInfo JSWebAssemblyCompileError::s_info = { "WebAssembly.CompileError", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyCompileError) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyCompileError.h
new file mode 100644 (file)
index 0000000..1a77efb
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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 "ErrorInstance.h"
+
+namespace JSC {
+
+class JSWebAssemblyCompileError : public ErrorInstance {
+public:
+    typedef ErrorInstance Base;
+
+    static JSWebAssemblyCompileError* create(ExecState*, Structure*, const String&, bool);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyCompileError(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
new file mode 100644 (file)
index 0000000..bd159bb
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyInstance.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyInstance* JSWebAssemblyInstance::create(VM& vm, Structure* structure)
+{
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyInstance>(vm.heap)) JSWebAssemblyInstance(vm, structure);
+    instance->finishCreation(vm);
+    return instance;
+}
+
+Structure* JSWebAssemblyInstance::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+JSWebAssemblyInstance::JSWebAssemblyInstance(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+void JSWebAssemblyInstance::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void JSWebAssemblyInstance::destroy(JSCell* cell)
+{
+    static_cast<JSWebAssemblyInstance*>(cell)->JSWebAssemblyInstance::~JSWebAssemblyInstance();
+}
+
+void JSWebAssemblyInstance::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<JSWebAssemblyInstance*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+}
+
+const ClassInfo JSWebAssemblyInstance::s_info = { "WebAssembly.Instance", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyInstance) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h
new file mode 100644 (file)
index 0000000..da4bf80
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class JSWebAssemblyInstance : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static JSWebAssemblyInstance* create(VM&, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyInstance(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp
new file mode 100644 (file)
index 0000000..6a465de
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyMemory.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyMemory* JSWebAssemblyMemory::create(VM& vm, Structure* structure)
+{
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyMemory>(vm.heap)) JSWebAssemblyMemory(vm, structure);
+    instance->finishCreation(vm);
+    return instance;
+}
+
+Structure* JSWebAssemblyMemory::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+JSWebAssemblyMemory::JSWebAssemblyMemory(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+void JSWebAssemblyMemory::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void JSWebAssemblyMemory::destroy(JSCell* cell)
+{
+    static_cast<JSWebAssemblyMemory*>(cell)->JSWebAssemblyMemory::~JSWebAssemblyMemory();
+}
+
+void JSWebAssemblyMemory::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<JSWebAssemblyMemory*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+}
+
+const ClassInfo JSWebAssemblyMemory::s_info = { "WebAssembly.Memory", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyMemory) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.h
new file mode 100644 (file)
index 0000000..a965a99
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class JSWebAssemblyMemory : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static JSWebAssemblyMemory* create(VM&, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyMemory(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp
new file mode 100644 (file)
index 0000000..edc54cc
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyModule.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyModule* JSWebAssemblyModule::create(VM& vm, Structure* structure)
+{
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyModule>(vm.heap)) JSWebAssemblyModule(vm, structure);
+    instance->finishCreation(vm);
+    return instance;
+}
+
+Structure* JSWebAssemblyModule::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+JSWebAssemblyModule::JSWebAssemblyModule(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+void JSWebAssemblyModule::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void JSWebAssemblyModule::destroy(JSCell* cell)
+{
+    static_cast<JSWebAssemblyModule*>(cell)->JSWebAssemblyModule::~JSWebAssemblyModule();
+}
+
+void JSWebAssemblyModule::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<JSWebAssemblyModule*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+}
+
+const ClassInfo JSWebAssemblyModule::s_info = { "WebAssembly.Module", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyModule) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h
new file mode 100644 (file)
index 0000000..7723211
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class JSWebAssemblyModule : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static JSWebAssemblyModule* create(VM&, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyModule(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.cpp
new file mode 100644 (file)
index 0000000..8ce2e79
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyRuntimeError.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyRuntimeError* JSWebAssemblyRuntimeError::create(ExecState* state, Structure* structure, const String& message, bool useCurrentFrame)
+{
+    auto& vm = state->vm();
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyRuntimeError>(vm.heap)) JSWebAssemblyRuntimeError(vm, structure);
+    instance->finishCreation(state, vm, message, useCurrentFrame);
+    return instance;
+}
+
+JSWebAssemblyRuntimeError::JSWebAssemblyRuntimeError(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+const ClassInfo JSWebAssemblyRuntimeError::s_info = { "WebAssembly.RuntimeError", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyRuntimeError) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyRuntimeError.h
new file mode 100644 (file)
index 0000000..c12a1fa
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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 "ErrorInstance.h"
+
+namespace JSC {
+
+class JSWebAssemblyRuntimeError : public ErrorInstance {
+public:
+    typedef ErrorInstance Base;
+
+    static JSWebAssemblyRuntimeError* create(ExecState*, Structure*, const String&, bool);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyRuntimeError(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp
new file mode 100644 (file)
index 0000000..23d5258
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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 "config.h"
+#include "JSWebAssemblyTable.h"
+
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSWebAssemblyTable* JSWebAssemblyTable::create(VM& vm, Structure* structure)
+{
+    auto* instance = new (NotNull, allocateCell<JSWebAssemblyTable>(vm.heap)) JSWebAssemblyTable(vm, structure);
+    instance->finishCreation(vm);
+    return instance;
+}
+
+Structure* JSWebAssemblyTable::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+JSWebAssemblyTable::JSWebAssemblyTable(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+void JSWebAssemblyTable::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+void JSWebAssemblyTable::destroy(JSCell* cell)
+{
+    static_cast<JSWebAssemblyTable*>(cell)->JSWebAssemblyTable::~JSWebAssemblyTable();
+}
+
+void JSWebAssemblyTable::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<JSWebAssemblyTable*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+
+    Base::visitChildren(thisObject, visitor);
+}
+
+const ClassInfo JSWebAssemblyTable::s_info = { "WebAssembly.Table", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyTable) };
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h b/Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h
new file mode 100644 (file)
index 0000000..d399f9e
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class JSWebAssemblyTable : public JSDestructibleObject {
+public:
+    typedef JSDestructibleObject Base;
+
+    static JSWebAssemblyTable* create(VM&, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    JSWebAssemblyTable(VM&, Structure*);
+    void finishCreation(VM&);
+    static void destroy(JSCell*);
+    static void visitChildren(JSCell*, SlotVisitor&);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp
new file mode 100644 (file)
index 0000000..d17864c
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyCompileErrorConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyCompileErrorPrototype.h"
+
+#include "WebAssemblyCompileErrorConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyCompileErrorConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyCompileError, CREATE_METHOD_TABLE(WebAssemblyCompileErrorConstructor) };
+
+/* Source for WebAssemblyCompileErrorConstructor.lut.h
+ @begin constructorTableWebAssemblyCompileError
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyCompileError(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the CompileError constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyCompileError(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.CompileError"));
+}
+
+WebAssemblyCompileErrorConstructor* WebAssemblyCompileErrorConstructor::create(VM& vm, Structure* structure, WebAssemblyCompileErrorPrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyCompileErrorConstructor>(vm.heap)) WebAssemblyCompileErrorConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyCompileErrorConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyCompileErrorConstructor::finishCreation(VM& vm, WebAssemblyCompileErrorPrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("CompileError"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_CompileErrorStructure.set(vm, this, structure);
+}
+
+WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyCompileErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyCompileError;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyCompileErrorConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyCompileError;
+    return CallType::Host;
+}
+
+void WebAssemblyCompileErrorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyCompileErrorConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_CompileErrorStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.h
new file mode 100644 (file)
index 0000000..7a524b9
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyCompileErrorPrototype;
+
+class WebAssemblyCompileErrorConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyCompileErrorConstructor* create(VM&, Structure*, WebAssemblyCompileErrorPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* CompileErrorStructure() const { return m_CompileErrorStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyCompileErrorPrototype*, Structure*);
+
+private:
+    WebAssemblyCompileErrorConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_CompileErrorStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp
new file mode 100644 (file)
index 0000000..993c496
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyCompileErrorPrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyCompileErrorPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyCompileErrorPrototype::s_info = { "WebAssembly.CompileError.prototype", &Base::s_info, &prototypeTableWebAssemblyCompileError, CREATE_METHOD_TABLE(WebAssemblyCompileErrorPrototype) };
+
+/* Source for WebAssemblyCompileErrorPrototype.lut.h
+ @begin prototypeTableWebAssemblyCompileError
+ @end
+ */
+
+WebAssemblyCompileErrorPrototype* WebAssemblyCompileErrorPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyCompileErrorPrototype>(vm.heap)) WebAssemblyCompileErrorPrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyCompileErrorPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyCompileErrorPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyCompileErrorPrototype::WebAssemblyCompileErrorPrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.h
new file mode 100644 (file)
index 0000000..1a39c36
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyCompileErrorPrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyCompileErrorPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyCompileErrorPrototype(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp
new file mode 100644 (file)
index 0000000..a56855a
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyInstanceConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyInstancePrototype.h"
+
+#include "WebAssemblyInstanceConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyInstanceConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyInstance, CREATE_METHOD_TABLE(WebAssemblyInstanceConstructor) };
+
+/* Source for WebAssemblyInstanceConstructor.lut.h
+ @begin constructorTableWebAssemblyInstance
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyInstance(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the Instance constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyInstance(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.Instance"));
+}
+
+WebAssemblyInstanceConstructor* WebAssemblyInstanceConstructor::create(VM& vm, Structure* structure, WebAssemblyInstancePrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyInstanceConstructor>(vm.heap)) WebAssemblyInstanceConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyInstanceConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyInstanceConstructor::finishCreation(VM& vm, WebAssemblyInstancePrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("Instance"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_InstanceStructure.set(vm, this, structure);
+}
+
+WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyInstanceConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyInstance;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyInstanceConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyInstance;
+    return CallType::Host;
+}
+
+void WebAssemblyInstanceConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyInstanceConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_InstanceStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.h
new file mode 100644 (file)
index 0000000..736bd8c
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyInstancePrototype;
+
+class WebAssemblyInstanceConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyInstanceConstructor* create(VM&, Structure*, WebAssemblyInstancePrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* InstanceStructure() const { return m_InstanceStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyInstancePrototype*, Structure*);
+
+private:
+    WebAssemblyInstanceConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_InstanceStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.cpp
new file mode 100644 (file)
index 0000000..ede3c79
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyInstancePrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyInstancePrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyInstancePrototype::s_info = { "WebAssembly.Instance.prototype", &Base::s_info, &prototypeTableWebAssemblyInstance, CREATE_METHOD_TABLE(WebAssemblyInstancePrototype) };
+
+/* Source for WebAssemblyInstancePrototype.lut.h
+ @begin prototypeTableWebAssemblyInstance
+ @end
+ */
+
+WebAssemblyInstancePrototype* WebAssemblyInstancePrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyInstancePrototype>(vm.heap)) WebAssemblyInstancePrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyInstancePrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyInstancePrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyInstancePrototype::WebAssemblyInstancePrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyInstancePrototype.h
new file mode 100644 (file)
index 0000000..93b4ac7
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyInstancePrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyInstancePrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyInstancePrototype(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp
new file mode 100644 (file)
index 0000000..1f6370d
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyMemoryConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyMemoryPrototype.h"
+
+#include "WebAssemblyMemoryConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyMemoryConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyMemory, CREATE_METHOD_TABLE(WebAssemblyMemoryConstructor) };
+
+/* Source for WebAssemblyMemoryConstructor.lut.h
+ @begin constructorTableWebAssemblyMemory
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyMemory(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the Memory constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyMemory(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.Memory"));
+}
+
+WebAssemblyMemoryConstructor* WebAssemblyMemoryConstructor::create(VM& vm, Structure* structure, WebAssemblyMemoryPrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyMemoryConstructor>(vm.heap)) WebAssemblyMemoryConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyMemoryConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyMemoryConstructor::finishCreation(VM& vm, WebAssemblyMemoryPrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("Memory"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_MemoryStructure.set(vm, this, structure);
+}
+
+WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyMemoryConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyMemory;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyMemoryConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyMemory;
+    return CallType::Host;
+}
+
+void WebAssemblyMemoryConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyMemoryConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_MemoryStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.h
new file mode 100644 (file)
index 0000000..9525364
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyMemoryPrototype;
+
+class WebAssemblyMemoryConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyMemoryConstructor* create(VM&, Structure*, WebAssemblyMemoryPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* MemoryStructure() const { return m_MemoryStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyMemoryPrototype*, Structure*);
+
+private:
+    WebAssemblyMemoryConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_MemoryStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp
new file mode 100644 (file)
index 0000000..60e4888
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyMemoryPrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyMemoryPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyMemoryPrototype::s_info = { "WebAssembly.Memory.prototype", &Base::s_info, &prototypeTableWebAssemblyMemory, CREATE_METHOD_TABLE(WebAssemblyMemoryPrototype) };
+
+/* Source for WebAssemblyMemoryPrototype.lut.h
+ @begin prototypeTableWebAssemblyMemory
+ @end
+ */
+
+WebAssemblyMemoryPrototype* WebAssemblyMemoryPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyMemoryPrototype>(vm.heap)) WebAssemblyMemoryPrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyMemoryPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyMemoryPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyMemoryPrototype::WebAssemblyMemoryPrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h
new file mode 100644 (file)
index 0000000..9d3f850
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyMemoryPrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyMemoryPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyMemoryPrototype(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp
new file mode 100644 (file)
index 0000000..c838b3d
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyModuleConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyModulePrototype.h"
+
+#include "WebAssemblyModuleConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyModuleConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyModule, CREATE_METHOD_TABLE(WebAssemblyModuleConstructor) };
+
+/* Source for WebAssemblyModuleConstructor.lut.h
+ @begin constructorTableWebAssemblyModule
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyModule(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the Module constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyModule(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.Module"));
+}
+
+WebAssemblyModuleConstructor* WebAssemblyModuleConstructor::create(VM& vm, Structure* structure, WebAssemblyModulePrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyModuleConstructor>(vm.heap)) WebAssemblyModuleConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyModuleConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyModuleConstructor::finishCreation(VM& vm, WebAssemblyModulePrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("Module"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_ModuleStructure.set(vm, this, structure);
+}
+
+WebAssemblyModuleConstructor::WebAssemblyModuleConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyModuleConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyModule;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyModuleConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyModule;
+    return CallType::Host;
+}
+
+void WebAssemblyModuleConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyModuleConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_ModuleStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.h
new file mode 100644 (file)
index 0000000..3aa4afa
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyModulePrototype;
+
+class WebAssemblyModuleConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyModuleConstructor* create(VM&, Structure*, WebAssemblyModulePrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* ModuleStructure() const { return m_ModuleStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyModulePrototype*, Structure*);
+
+private:
+    WebAssemblyModuleConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_ModuleStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp
new file mode 100644 (file)
index 0000000..9db0ce9
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyModulePrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyModulePrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyModulePrototype::s_info = { "WebAssembly.Module.prototype", &Base::s_info, &prototypeTableWebAssemblyModule, CREATE_METHOD_TABLE(WebAssemblyModulePrototype) };
+
+/* Source for WebAssemblyModulePrototype.lut.h
+ @begin prototypeTableWebAssemblyModule
+ @end
+ */
+
+WebAssemblyModulePrototype* WebAssemblyModulePrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyModulePrototype>(vm.heap)) WebAssemblyModulePrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyModulePrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyModulePrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyModulePrototype::WebAssemblyModulePrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.h
new file mode 100644 (file)
index 0000000..8a713d5
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyModulePrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyModulePrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyModulePrototype(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
new file mode 100644 (file)
index 0000000..b3067e5
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyRuntimeErrorConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyRuntimeErrorPrototype.h"
+
+#include "WebAssemblyRuntimeErrorConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyRuntimeErrorConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyRuntimeError, CREATE_METHOD_TABLE(WebAssemblyRuntimeErrorConstructor) };
+
+/* Source for WebAssemblyRuntimeErrorConstructor.lut.h
+ @begin constructorTableWebAssemblyRuntimeError
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyRuntimeError(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the RuntimeError constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyRuntimeError(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.RuntimeError"));
+}
+
+WebAssemblyRuntimeErrorConstructor* WebAssemblyRuntimeErrorConstructor::create(VM& vm, Structure* structure, WebAssemblyRuntimeErrorPrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyRuntimeErrorConstructor>(vm.heap)) WebAssemblyRuntimeErrorConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyRuntimeErrorConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyRuntimeErrorConstructor::finishCreation(VM& vm, WebAssemblyRuntimeErrorPrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("RuntimeError"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_RuntimeErrorStructure.set(vm, this, structure);
+}
+
+WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyRuntimeErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyRuntimeError;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyRuntimeErrorConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyRuntimeError;
+    return CallType::Host;
+}
+
+void WebAssemblyRuntimeErrorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyRuntimeErrorConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_RuntimeErrorStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.h
new file mode 100644 (file)
index 0000000..9fc91c7
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyRuntimeErrorPrototype;
+
+class WebAssemblyRuntimeErrorConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyRuntimeErrorConstructor* create(VM&, Structure*, WebAssemblyRuntimeErrorPrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* RuntimeErrorStructure() const { return m_RuntimeErrorStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyRuntimeErrorPrototype*, Structure*);
+
+private:
+    WebAssemblyRuntimeErrorConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_RuntimeErrorStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.cpp
new file mode 100644 (file)
index 0000000..dbc6677
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyRuntimeErrorPrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyRuntimeErrorPrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyRuntimeErrorPrototype::s_info = { "WebAssembly.RuntimeError.prototype", &Base::s_info, &prototypeTableWebAssemblyRuntimeError, CREATE_METHOD_TABLE(WebAssemblyRuntimeErrorPrototype) };
+
+/* Source for WebAssemblyRuntimeErrorPrototype.lut.h
+ @begin prototypeTableWebAssemblyRuntimeError
+ @end
+ */
+
+WebAssemblyRuntimeErrorPrototype* WebAssemblyRuntimeErrorPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyRuntimeErrorPrototype>(vm.heap)) WebAssemblyRuntimeErrorPrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyRuntimeErrorPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyRuntimeErrorPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyRuntimeErrorPrototype::WebAssemblyRuntimeErrorPrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorPrototype.h
new file mode 100644 (file)
index 0000000..a729fb0
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyRuntimeErrorPrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyRuntimeErrorPrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyRuntimeErrorPrototype(VM&, Structure*);
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp
new file mode 100644 (file)
index 0000000..053d8bf
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyTableConstructor.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+#include "WebAssemblyTablePrototype.h"
+
+#include "WebAssemblyTableConstructor.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyTableConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyTable, CREATE_METHOD_TABLE(WebAssemblyTableConstructor) };
+
+/* Source for WebAssemblyTableConstructor.lut.h
+ @begin constructorTableWebAssemblyTable
+ @end
+ */
+
+static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyTable(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwException(state, scope, createError(state, ASCIILiteral("WebAssembly doesn't yet implement the Table constructor property"))));
+}
+
+static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyTable(ExecState* state)
+{
+    VM& vm = state->vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.Table"));
+}
+
+WebAssemblyTableConstructor* WebAssemblyTableConstructor::create(VM& vm, Structure* structure, WebAssemblyTablePrototype* thisPrototype, Structure* thisStructure)
+{
+    auto* constructor = new (NotNull, allocateCell<WebAssemblyTableConstructor>(vm.heap)) WebAssemblyTableConstructor(vm, structure);
+    constructor->finishCreation(vm, thisPrototype, thisStructure);
+    return constructor;
+}
+
+Structure* WebAssemblyTableConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyTableConstructor::finishCreation(VM& vm, WebAssemblyTablePrototype* prototype, Structure* structure)
+{
+    Base::finishCreation(vm, ASCIILiteral("Table"));
+    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
+    m_TableStructure.set(vm, this, structure);
+}
+
+WebAssemblyTableConstructor::WebAssemblyTableConstructor(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+ConstructType WebAssemblyTableConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSWebAssemblyTable;
+    return ConstructType::Host;
+}
+
+CallType WebAssemblyTableConstructor::getCallData(JSCell*, CallData& callData)
+{
+    callData.native.function = callJSWebAssemblyTable;
+    return CallType::Host;
+}
+
+void WebAssemblyTableConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    auto* thisObject = jsCast<WebAssemblyTableConstructor*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_TableStructure);
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.h
new file mode 100644 (file)
index 0000000..894b514
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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 "InternalFunction.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyTablePrototype;
+
+class WebAssemblyTableConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyTableConstructor* create(VM&, Structure*, WebAssemblyTablePrototype*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+    Structure* TableStructure() const { return m_TableStructure.get(); }
+
+protected:
+    void finishCreation(VM&, WebAssemblyTablePrototype*, Structure*);
+
+private:
+    WebAssemblyTableConstructor(VM&, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+    WriteBarrier<Structure> m_TableStructure;
+};
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp
new file mode 100644 (file)
index 0000000..5c32097
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * 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 "config.h"
+#include "WebAssemblyTablePrototype.h"
+
+#include "FunctionPrototype.h"
+#include "JSCInlines.h"
+
+#include "WebAssemblyTablePrototype.lut.h"
+
+namespace JSC {
+
+const ClassInfo WebAssemblyTablePrototype::s_info = { "WebAssembly.Table.prototype", &Base::s_info, &prototypeTableWebAssemblyTable, CREATE_METHOD_TABLE(WebAssemblyTablePrototype) };
+
+/* Source for WebAssemblyTablePrototype.lut.h
+ @begin prototypeTableWebAssemblyTable
+ @end
+ */
+
+WebAssemblyTablePrototype* WebAssemblyTablePrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
+{
+    auto* object = new (NotNull, allocateCell<WebAssemblyTablePrototype>(vm.heap)) WebAssemblyTablePrototype(vm, structure);
+    object->finishCreation(vm);
+    return object;
+}
+
+Structure* WebAssemblyTablePrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void WebAssemblyTablePrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+}
+
+WebAssemblyTablePrototype::WebAssemblyTablePrototype(VM& vm, Structure* structure)
+    : Base(vm, structure)
+{
+}
+
+} // namespace JSC
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h b/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h
new file mode 100644 (file)
index 0000000..c63e001
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 "JSDestructibleObject.h"
+#include "JSObject.h"
+
+namespace JSC {
+
+class WebAssemblyTablePrototype : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
+
+    static WebAssemblyTablePrototype* create(VM&, JSGlobalObject*, Structure*);
+    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
+
+    DECLARE_INFO;
+
+protected:
+    void finishCreation(VM&);
+
+private:
+    WebAssemblyTablePrototype(VM&, Structure*);
+};
+
+} // namespace JSC