Title: [210568] branches/safari-603-branch
Revision
210568
Author
[email protected]
Date
2017-01-10 17:22:21 -0800 (Tue, 10 Jan 2017)

Log Message

Roll out r210028 via r210336. rdar://problem/29912353

Modified Paths

Removed Paths

Diff

Modified: branches/safari-603-branch/JSTests/ChangeLog (210567 => 210568)


--- branches/safari-603-branch/JSTests/ChangeLog	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/ChangeLog	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,3 +1,7 @@
+2017-01-10  Matthew Hanson  <[email protected]>
+
+        Rollout r210336. rdar://problem/29912353
+
 2017-01-06  Matthew Hanson  <[email protected]>
 
         Revert the following merges as part of disabling Web Assembly. rdar://problem/29890343

Modified: branches/safari-603-branch/JSTests/wasm/js-api/element-data.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/element-data.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/element-data.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -37,7 +37,7 @@
             table: table,
         }
     };
-    assert.throws(() => new WebAssembly.Instance(module, imports), WebAssembly.LinkError, `Element is trying to set an out of bounds table index (evaluating 'new WebAssembly.Instance(module, imports)')`);
+    assert.throws(() => new WebAssembly.Instance(module, imports), RangeError, `Element is trying to set an out of bounds table index`);
     // On Element failure, the Data section shouldn't have executed.
     const buffer = new Uint8Array(memory.buffer);
     for (let idx = 0; idx < memSizeInPages * pageSizeInBytes; ++idx) {

Modified: branches/safari-603-branch/JSTests/wasm/js-api/element.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/element.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/element.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -141,6 +141,6 @@
 
     for (let i = 19; i < 19 + 5; i++) {
         const table = new WebAssembly.Table({element: "anyfunc", initial: i});
-        badInstantiation(table, WebAssembly.LinkError, "Element is trying to set an out of bounds table index (evaluating 'new WebAssembly.Instance(module, {imp: {table: actualTable}})')");
+        badInstantiation(table, RangeError, "Element is trying to set an out of bounds table index");
     }
 }

Modified: branches/safari-603-branch/JSTests/wasm/js-api/global-error.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/global-error.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/global-error.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -185,5 +185,5 @@
     bin.trim();
 
     const module = new WebAssembly.Module(bin.get());
-    assert.throws(() => new WebAssembly.Instance(module, { imp: { global: imp } }), WebAssembly.LinkError, "imported global must be a number (evaluating 'new WebAssembly.Instance(module, { imp: { global: imp } })')");
+    assert.throws(() => new WebAssembly.Instance(module, { imp: { global: imp } }), TypeError, "imported global must be a number (evaluating 'new WebAssembly.Instance(module, { imp: { global: imp } })')");
 }

Modified: branches/safari-603-branch/JSTests/wasm/js-api/table.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/table.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/table.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -189,14 +189,14 @@
             .Code()
             .End();
         const module = new WebAssembly.Module(builder.WebAssembly().get());
-        assert.throws(() => new WebAssembly.Instance(module, {imp: {table}}), WebAssembly.LinkError, message);
+        assert.throws(() => new WebAssembly.Instance(module, {imp: {table}}), TypeError, message);
     }
 
     const badTables = [
-        [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, element: "anyfunc"}), "Table import does not have a 'maximum' but the module requires that it does (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"],
-        [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, maximum:101, element: "anyfunc"}), "Imported Table's 'maximum' is larger than the module's expected 'maximum' (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"],
-        [{initial: 100, element:"anyfunc"}, new WebAssembly.Table({initial:10, element: "anyfunc"}), "Table import provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"],
-        [{initial: 10, element:"anyfunc"}, new WebAssembly.Table({initial:9, element: "anyfunc"}), "Table import provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"],
+        [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, element: "anyfunc"}), "Table import does not have a 'maximum' but the module requires that it does"],
+        [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, maximum:101, element: "anyfunc"}), "Imported Table's 'maximum' is larger than the module's expected 'maximum'"],
+        [{initial: 100, element:"anyfunc"}, new WebAssembly.Table({initial:10, element: "anyfunc"}), "Table import provided an 'initial' that is too small"],
+        [{initial: 10, element:"anyfunc"}, new WebAssembly.Table({initial:9, element: "anyfunc"}), "Table import provided an 'initial' that is too small"],
     ];
     for (const [d, t, m] of badTables) {
         assertBadTableInstance(d, t, m);
@@ -251,7 +251,7 @@
             .Code()
             .End();
         const module = new WebAssembly.Module(builder.WebAssembly().get());
-        assert.throws(() => new WebAssembly.Instance(module, {imp: {table}}), WebAssembly.LinkError, "Table import is not an instance of WebAssembly.Table (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')");
+        assert.throws(() => new WebAssembly.Instance(module, {imp: {table}}), TypeError, "Table import is not an instance of WebAssembly.Table");
     }
     assertBadTable(25);
     assertBadTable(new Object);

Modified: branches/safari-603-branch/JSTests/wasm/js-api/test_Data.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/test_Data.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/test_Data.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -75,7 +75,7 @@
     const bin = builder.WebAssembly().get();
     const module = new WebAssembly.Module(bin);
     const memory = new WebAssembly.Memory(memoryDescription);
-    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), WebAssembly.LinkError, `Invalid data segment initialization: segment of 65537 bytes memory of 65536 bytes, at offset 0, segment is too big (evaluating 'new WebAssembly.Instance(module, { imp: { memory: memory } })')`);
+    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), RangeError, `Invalid data segment initialization: segment of 65537 bytes memory of 65536 bytes, at offset 0, segment is too big`);
     assertMemoryAllZero(memory);
 })();
 
@@ -89,7 +89,7 @@
     const bin = builder.WebAssembly().get();
     const module = new WebAssembly.Module(bin);
     const memory = new WebAssembly.Memory(memoryDescription);
-    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), WebAssembly.LinkError, `Invalid data segment initialization: segment of 1 bytes memory of 65536 bytes, at offset 65536, segment writes outside of memory (evaluating 'new WebAssembly.Instance(module, { imp: { memory: memory } })')`);
+    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), RangeError, `Invalid data segment initialization: segment of 1 bytes memory of 65536 bytes, at offset 65536, segment writes outside of memory`);
     assertMemoryAllZero(memory);
 })();
 
@@ -103,7 +103,7 @@
     const bin = builder.WebAssembly().get();
     const module = new WebAssembly.Module(bin);
     const memory = new WebAssembly.Memory(memoryDescription);
-    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), WebAssembly.LinkError, `Invalid data segment initialization: segment of 2 bytes memory of 65536 bytes, at offset 65535, segment writes outside of memory (evaluating 'new WebAssembly.Instance(module, { imp: { memory: memory } })')`);
+    assert.throws(() => new WebAssembly.Instance(module, { imp: { memory: memory } }), RangeError, `Invalid data segment initialization: segment of 2 bytes memory of 65536 bytes, at offset 65535, segment writes outside of memory`);
     assertMemoryAllZero(memory);
 })();
 

Modified: branches/safari-603-branch/JSTests/wasm/js-api/test_basic_api.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/test_basic_api.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/test_basic_api.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -24,7 +24,6 @@
     "Memory":       { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1 },
     "Table":        { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1 },
     "CompileError": { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1 },
-    "LinkError":    { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1 },
     "RuntimeError": { typeofvalue: "function", writable: true, configurable: true, enumerable: false, length: 1 },
 };
 
@@ -84,7 +83,6 @@
         new WebAssembly.Table({initial: 20, maximum: 25, element: "anyfunc"});
         break;
     case "CompileError":
-    case "LinkError":
     case "RuntimeError": {
         const e = new WebAssembly[c];
         assert.eq(e instanceof WebAssembly[c], true);
@@ -94,7 +92,7 @@
         assert.eq(typeof e.stack, "string");
         const sillyString = "uh-oh!";
         const e2 = new WebAssembly[c](sillyString);
-        // FIXME fix Compile / Runtime errors for this: assert.eq(e2.message, sillyString + " (evaluating 'new WebAssembly[c](sillyString)')");
+        assert.eq(e2.message, sillyString);
     } break;
     default: throw new Error(`Implementation error: unexpected constructor property "${c}"`);
     }

Modified: branches/safari-603-branch/JSTests/wasm/js-api/test_memory.js (210567 => 210568)


--- branches/safari-603-branch/JSTests/wasm/js-api/test_memory.js	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/JSTests/wasm/js-api/test_memory.js	2017-01-11 01:22:21 UTC (rev 210568)
@@ -318,14 +318,28 @@
     const bin = builder.WebAssembly().get();
     const module = new WebAssembly.Module(bin);
 
-    assert.throws(() => new WebAssembly.Instance(module, 20), TypeError, `second argument to WebAssembly.Instance must be undefined or an Object (evaluating 'new WebAssembly.Instance(module, 20)')`);
-    assert.throws(() => new WebAssembly.Instance(module, {}), TypeError, `import must be an object (evaluating 'new WebAssembly.Instance(module, {})')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { } }), WebAssembly.LinkError, `Memory import is not an instance of WebAssembly.Memory (evaluating 'new WebAssembly.Instance(module, {imp: { } })')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { memory: 20 } }), WebAssembly.LinkError, `Memory import is not an instance of WebAssembly.Memory (evaluating 'new WebAssembly.Instance(module, {imp: { memory: 20 } })')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { memory: [] } }), WebAssembly.LinkError, `Memory import is not an instance of WebAssembly.Memory (evaluating 'new WebAssembly.Instance(module, {imp: { memory: [] } })')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 19, maximum: 25}) } }), WebAssembly.LinkError, `Memory import provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 19, maximum: 25}) } })')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 20}) } }), WebAssembly.LinkError, `Memory import did not have a 'maximum' but the module requires that it does (evaluating 'new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 20}) } })')`);
-    assert.throws(() => new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 20, maximum: 26}) } }), WebAssembly.LinkError, `Memory imports 'maximum' is larger than the module's expected 'maximum' (evaluating 'new WebAssembly.Instance(module, {imp: { memory: new WebAssembly.Memory({initial: 20, maximum: 26}) } })')`);
+    function testMemImportError(instanceObj, expectedError) {
+        let threw = false;
+        try {
+            new WebAssembly.Instance(module, instanceObj);
+        } catch(e) {
+            assert.truthy(e instanceof TypeError);
+            threw = true;
+            if (expectedError) {
+                assert.truthy(e.message === expectedError);
+            }
+        }
+        assert.truthy(threw);
+    }
+
+    testMemImportError(20);
+    testMemImportError({ });
+    testMemImportError({imp: { } });
+    testMemImportError({imp: { memory: 20 } });
+    testMemImportError({imp: { memory: [] } });
+    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 19, maximum: 25}) } }, "Memory import provided an 'initial' that is too small");
+    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 20}) } }, "Memory import did not have a 'maximum' but the module requires that it does");
+    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 20, maximum: 26}) } }, "Memory imports 'maximum' is larger than the module's expected 'maximum");
 });
 
 test(function() {
@@ -352,11 +366,11 @@
     const module = new WebAssembly.Module(bin);
 
     function testMemImportError(instanceObj, expectedError) {
-        assert.throws(() => new WebAssembly.Instance(module, instanceObj), WebAssembly.LinkError, expectedError);
+        assert.throws(() => new WebAssembly.Instance(module, instanceObj), TypeError, expectedError);
     }
 
-    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 19, maximum: 25}) } }, "Memory import provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, instanceObj)')");
-    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 19}) } }, "Memory import provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, instanceObj)')");
+    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 19, maximum: 25}) } }, "Memory import provided an 'initial' that is too small");
+    testMemImportError({imp: { memory: new WebAssembly.Memory({initial: 19}) } }, "Memory import provided an 'initial' that is too small");
 
     // This should not throw.
     new WebAssembly.Instance(module, {imp: {memory: new WebAssembly.Memory({initial:20})}});

Modified: branches/safari-603-branch/Source/_javascript_Core/CMakeLists.txt (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/CMakeLists.txt	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/CMakeLists.txt	2017-01-11 01:22:21 UTC (rev 210568)
@@ -912,7 +912,6 @@
     wasm/js/JSWebAssemblyCallee.cpp
     wasm/js/JSWebAssemblyCompileError.cpp
     wasm/js/JSWebAssemblyInstance.cpp
-    wasm/js/JSWebAssemblyLinkError.cpp
     wasm/js/JSWebAssemblyMemory.cpp
     wasm/js/JSWebAssemblyModule.cpp
     wasm/js/JSWebAssemblyRuntimeError.cpp
@@ -922,8 +921,6 @@
     wasm/js/WebAssemblyFunction.cpp
     wasm/js/WebAssemblyInstanceConstructor.cpp
     wasm/js/WebAssemblyInstancePrototype.cpp
-    wasm/js/WebAssemblyLinkErrorConstructor.cpp
-    wasm/js/WebAssemblyLinkErrorPrototype.cpp
     wasm/js/WebAssemblyMemoryConstructor.cpp
     wasm/js/WebAssemblyMemoryPrototype.cpp
     wasm/js/WebAssemblyModuleConstructor.cpp
@@ -991,8 +988,6 @@
     wasm/js/WebAssemblyCompileErrorPrototype.cpp
     wasm/js/WebAssemblyInstanceConstructor.cpp
     wasm/js/WebAssemblyInstancePrototype.cpp
-    wasm/js/WebAssemblyLinkErrorConstructor.cpp
-    wasm/js/WebAssemblyLinkErrorPrototype.cpp
     wasm/js/WebAssemblyMemoryConstructor.cpp
     wasm/js/WebAssemblyMemoryPrototype.cpp
     wasm/js/WebAssemblyModuleConstructor.cpp

Modified: branches/safari-603-branch/Source/_javascript_Core/ChangeLog (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/ChangeLog	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/ChangeLog	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,3 +1,7 @@
+2017-01-10  Matthew Hanson  <[email protected]>
+
+        Rollout r210336. rdar://problem/29912353
+
 2017-01-09  Babak Shafiei  <[email protected]>
 
         Merge r210458. rdar://problem/29911919

Modified: branches/safari-603-branch/Source/_javascript_Core/DerivedSources.make (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/DerivedSources.make	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/DerivedSources.make	2017-01-11 01:22:21 UTC (rev 210568)
@@ -169,8 +169,6 @@
     WebAssemblyCompileErrorPrototype.lut.h \
     WebAssemblyInstanceConstructor.lut.h \
     WebAssemblyInstancePrototype.lut.h \
-    WebAssemblyLinkErrorConstructor.lut.h \
-    WebAssemblyLinkErrorPrototype.lut.h \
     WebAssemblyMemoryConstructor.lut.h \
     WebAssemblyMemoryPrototype.lut.h \
     WebAssemblyModuleConstructor.lut.h \

Modified: branches/safari-603-branch/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2017-01-11 01:22:21 UTC (rev 210568)
@@ -2027,12 +2027,6 @@
 		ADBC54D51DF8EA2B005BF738 /* WebAssemblyToJSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */; };
 		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 */; };
-		ADE802981E08F1DE0058DE78 /* JSWebAssemblyLinkError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADE802931E08F1C90058DE78 /* JSWebAssemblyLinkError.cpp */; };
-		ADE802991E08F1DE0058DE78 /* JSWebAssemblyLinkError.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		ADE8029A1E08F1DE0058DE78 /* WebAssemblyLinkErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802951E08F1C90058DE78 /* WebAssemblyLinkErrorConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		ADE8029B1E08F1DE0058DE78 /* WebAssemblyLinkErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADE802961E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.cpp */; };
-		ADE8029C1E08F1DE0058DE78 /* WebAssemblyLinkErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802971E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		ADE8029E1E08F2280058DE78 /* WebAssemblyLinkErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADE8029D1E08F2260058DE78 /* WebAssemblyLinkErrorConstructor.cpp */; };
 		B59F89391891F29F00D5CCDC /* UnlinkedInstructionStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59F89381891ADB500D5CCDC /* UnlinkedInstructionStream.cpp */; };
 		BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
 		BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4508,12 +4502,6 @@
 		ADBC54D21DF8EA00005BF738 /* WebAssemblyToJSCallee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyToJSCallee.cpp; path = js/WebAssemblyToJSCallee.cpp; sourceTree = "<group>"; };
 		ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyToJSCallee.h; path = js/WebAssemblyToJSCallee.h; sourceTree = "<group>"; };
 		ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueRootSet.h; sourceTree = "<group>"; };
-		ADE802931E08F1C90058DE78 /* JSWebAssemblyLinkError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyLinkError.cpp; path = js/JSWebAssemblyLinkError.cpp; sourceTree = "<group>"; };
-		ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyLinkError.h; path = js/JSWebAssemblyLinkError.h; sourceTree = "<group>"; };
-		ADE802951E08F1C90058DE78 /* WebAssemblyLinkErrorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyLinkErrorConstructor.h; path = js/WebAssemblyLinkErrorConstructor.h; sourceTree = "<group>"; };
-		ADE802961E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyLinkErrorPrototype.cpp; path = js/WebAssemblyLinkErrorPrototype.cpp; sourceTree = "<group>"; };
-		ADE802971E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyLinkErrorPrototype.h; path = js/WebAssemblyLinkErrorPrototype.h; sourceTree = "<group>"; };
-		ADE8029D1E08F2260058DE78 /* WebAssemblyLinkErrorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyLinkErrorConstructor.cpp; path = js/WebAssemblyLinkErrorConstructor.cpp; sourceTree = "<group>"; };
 		B59F89371891AD3300D5CCDC /* UnlinkedInstructionStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedInstructionStream.h; sourceTree = "<group>"; };
 		B59F89381891ADB500D5CCDC /* UnlinkedInstructionStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkedInstructionStream.cpp; sourceTree = "<group>"; };
 		BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ToolExecutable.xcconfig; sourceTree = "<group>"; };
@@ -7609,8 +7597,6 @@
 				796FB4391DFF8C3F0039C95D /* JSWebAssemblyHelpers.h */,
 				AD2FCBA81DB58DA400B3E736 /* JSWebAssemblyInstance.cpp */,
 				AD2FCBA91DB58DA400B3E736 /* JSWebAssemblyInstance.h */,
-				ADE802931E08F1C90058DE78 /* JSWebAssemblyLinkError.cpp */,
-				ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */,
 				AD2FCBAA1DB58DA400B3E736 /* JSWebAssemblyMemory.cpp */,
 				AD2FCBAB1DB58DA400B3E736 /* JSWebAssemblyMemory.h */,
 				AD2FCB8C1DB5844000B3E736 /* JSWebAssemblyModule.cpp */,
@@ -7629,10 +7615,6 @@
 				AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */,
 				AD2FCBB61DB58DA400B3E736 /* WebAssemblyInstancePrototype.cpp */,
 				AD2FCBB71DB58DA400B3E736 /* WebAssemblyInstancePrototype.h */,
-				ADE8029D1E08F2260058DE78 /* WebAssemblyLinkErrorConstructor.cpp */,
-				ADE802951E08F1C90058DE78 /* WebAssemblyLinkErrorConstructor.h */,
-				ADE802961E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.cpp */,
-				ADE802971E08F1C90058DE78 /* WebAssemblyLinkErrorPrototype.h */,
 				AD2FCBB81DB58DA400B3E736 /* WebAssemblyMemoryConstructor.cpp */,
 				AD2FCBB91DB58DA400B3E736 /* WebAssemblyMemoryConstructor.h */,
 				AD2FCBBA1DB58DA400B3E736 /* WebAssemblyMemoryPrototype.cpp */,
@@ -7964,7 +7946,6 @@
 				FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */,
 				0F24E54217EA9F5900ABB217 /* CCallHelpers.h in Headers */,
 				0F070A471D543A8B006E7232 /* CellContainer.h in Headers */,
-				ADE8029A1E08F1DE0058DE78 /* WebAssemblyLinkErrorConstructor.h in Headers */,
 				0F070A481D543A90006E7232 /* CellContainerInlines.h in Headers */,
 				0F1C3DDA1BBCE09E00E523E4 /* CellState.h in Headers */,
 				BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */,
@@ -8441,7 +8422,6 @@
 				A5339EC61BB399A60054F005 /* InspectorHeapAgent.h in Headers */,
 				E35E03601B7AB43E0073AD2A /* InspectorInstrumentationObject.h in Headers */,
 				E33B3E261B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h in Headers */,
-				ADE802991E08F1DE0058DE78 /* JSWebAssemblyLinkError.h in Headers */,
 				A532438C18568335002ED692 /* InspectorProtocolObjects.h in Headers */,
 				A55D93AC18514F7900400DED /* InspectorProtocolTypes.h in Headers */,
 				A50E4B6218809DD50068A46D /* InspectorRuntimeAgent.h in Headers */,
@@ -8734,7 +8714,6 @@
 				E328C6C71DA4304500D255FD /* MaxFrameExtentForSlowPathCall.h in Headers */,
 				90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
 				0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */,
-				ADE8029C1E08F1DE0058DE78 /* WebAssemblyLinkErrorPrototype.h in Headers */,
 				7C008CE7187631B600955C24 /* Microtask.h in Headers */,
 				86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */,
 				C4703CD7192844CC0013FBEA /* models.py in Headers */,
@@ -9832,7 +9811,6 @@
 				A7D89CFB17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp in Sources */,
 				0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */,
 				A767B5B517A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.cpp in Sources */,
-				ADE8029E1E08F2280058DE78 /* WebAssemblyLinkErrorConstructor.cpp in Sources */,
 				79F8FC1E1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.cpp in Sources */,
 				0F5874ED194FEB1200AAB2C1 /* DFGMayExit.cpp in Sources */,
 				0F1725FF1B48719A00AC3A55 /* DFGMinifiedGraph.cpp in Sources */,
@@ -10120,7 +10098,6 @@
 				A5C3A1A518C0490200C9593A /* JSGlobalObjectConsoleClient.cpp in Sources */,
 				A59455921824744700CC3843 /* JSGlobalObjectDebuggable.cpp in Sources */,
 				A57D23E91891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp in Sources */,
-				ADE8029B1E08F1DE0058DE78 /* WebAssemblyLinkErrorPrototype.cpp in Sources */,
 				14E9D17B107EC469004DDA21 /* JSGlobalObjectFunctions.cpp in Sources */,
 				A51007C0187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp in Sources */,
 				A50E4B6318809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp in Sources */,
@@ -10184,7 +10161,6 @@
 				79E423E21DEE65320078D355 /* JSWebAssemblyCallee.cpp in Sources */,
 				AD2FCBE21DB58DAD00B3E736 /* JSWebAssemblyCompileError.cpp in Sources */,
 				AD2FCBE41DB58DAD00B3E736 /* JSWebAssemblyInstance.cpp in Sources */,
-				ADE802981E08F1DE0058DE78 /* JSWebAssemblyLinkError.cpp in Sources */,
 				AD2FCBE61DB58DAD00B3E736 /* JSWebAssemblyMemory.cpp in Sources */,
 				AD2FCC041DB58DAD00B3E736 /* JSWebAssemblyModule.cpp in Sources */,
 				AD2FCBE81DB58DAD00B3E736 /* JSWebAssemblyRuntimeError.cpp in Sources */,

Modified: branches/safari-603-branch/Source/_javascript_Core/builtins/BuiltinNames.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/builtins/BuiltinNames.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/builtins/BuiltinNames.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -166,7 +166,6 @@
     macro(Memory) \
     macro(Table) \
     macro(CompileError) \
-    macro(LinkError) \
     macro(RuntimeError) \
 
 

Modified: branches/safari-603-branch/Source/_javascript_Core/runtime/JSGlobalObject.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/runtime/JSGlobalObject.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/runtime/JSGlobalObject.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -140,7 +140,6 @@
 #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \
     macro(WebAssemblyCompileError, webAssemblyCompileError, WebAssemblyCompileError, WebAssemblyCompileError, CompileError, error) \
     macro(WebAssemblyInstance,     webAssemblyInstance,     WebAssemblyInstance,     WebAssemblyInstance,     Instance,     object) \
-    macro(WebAssemblyLinkError,    webAssemblyLinkError,    WebAssemblyLinkError,    WebAssemblyLinkError,    LinkError,    error) \
     macro(WebAssemblyMemory,       webAssemblyMemory,       WebAssemblyMemory,       WebAssemblyMemory,       Memory,       object) \
     macro(WebAssemblyModule,       webAssemblyModule,       WebAssemblyModule,       WebAssemblyModule,       Module,       object) \
     macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, WebAssemblyRuntimeError, WebAssemblyRuntimeError, RuntimeError, error) \

Modified: branches/safari-603-branch/Source/_javascript_Core/wasm/JSWebAssembly.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/JSWebAssembly.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/JSWebAssembly.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -31,7 +31,6 @@
 #include "js/JSWebAssemblyCallee.h"
 #include "js/JSWebAssemblyCompileError.h"
 #include "js/JSWebAssemblyInstance.h"
-#include "js/JSWebAssemblyLinkError.h"
 #include "js/JSWebAssemblyMemory.h"
 #include "js/JSWebAssemblyModule.h"
 #include "js/JSWebAssemblyRuntimeError.h"
@@ -41,8 +40,6 @@
 #include "js/WebAssemblyFunction.h"
 #include "js/WebAssemblyInstanceConstructor.h"
 #include "js/WebAssemblyInstancePrototype.h"
-#include "js/WebAssemblyLinkErrorConstructor.h"
-#include "js/WebAssemblyLinkErrorPrototype.h"
 #include "js/WebAssemblyMemoryConstructor.h"
 #include "js/WebAssemblyMemoryPrototype.h"
 #include "js/WebAssemblyModuleConstructor.h"

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.cpp (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.cpp	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.cpp	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,60 +0,0 @@
-/*
- * 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 "JSWebAssemblyLinkError.h"
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "JSCInlines.h"
-
-namespace JSC {
-
-JSWebAssemblyLinkError* JSWebAssemblyLinkError::create(ExecState* state, VM* vm, Structure* structure, const String& message)
-{
-    auto* instance = new (NotNull, allocateCell<JSWebAssemblyLinkError>(vm->heap)) JSWebAssemblyLinkError(*vm, structure);
-    instance->m_sourceAppender = defaultSourceAppender;
-    instance->finishCreation(state, *vm, message, true);
-    return instance;
-}
-
-JSWebAssemblyLinkError::JSWebAssemblyLinkError(VM& vm, Structure* structure)
-    : Base(vm, structure)
-{
-}
-
-const ClassInfo JSWebAssemblyLinkError::s_info = { "WebAssembly.LinkError", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWebAssemblyLinkError) };
-
-    
-JSObject* createJSWebAssemblyLinkError(ExecState* state, VM* vm, const String& message)
-{
-    ASSERT(!message.isEmpty());
-    JSGlobalObject* globalObject = state->lexicalGlobalObject();
-    return JSWebAssemblyLinkError::create(state, vm, globalObject->WebAssemblyLinkErrorStructure(), message);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/JSWebAssemblyLinkError.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "ErrorInstance.h"
-
-namespace JSC {
-
-class JSWebAssemblyLinkError : public ErrorInstance {
-public:
-    typedef ErrorInstance Base;
-
-    static JSWebAssemblyLinkError* create(ExecState*, VM*, Structure*, const String&);
-    static JSWebAssemblyLinkError* create(ExecState* state, VM* vm, Structure* structure, JSValue message)
-    {
-        return create(state, vm, structure, message.isUndefined() ? String() : message.toWTFString(state));
-    }
-
-    DECLARE_INFO;
-
-protected:
-    JSWebAssemblyLinkError(VM&, Structure*);
-};
-
-JSObject* createJSWebAssemblyLinkError(ExecState*, VM*, const String&);
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Modified: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyInstanceConstructor.cpp	2017-01-11 01:22:21 UTC (rev 210568)
@@ -33,7 +33,6 @@
 #include "JSModuleEnvironment.h"
 #include "JSModuleNamespaceObject.h"
 #include "JSWebAssemblyInstance.h"
-#include "JSWebAssemblyLinkError.h"
 #include "JSWebAssemblyMemory.h"
 #include "JSWebAssemblyModule.h"
 #include "WebAssemblyFunction.h"
@@ -109,9 +108,9 @@
         switch (import.kind) {
         case Wasm::ExternalKind::Function: {
             // 4. If i is a function import:
-            // i. If IsCallable(v) is false, throw a WebAssembly.LinkError.
+            // i. If IsCallable(v) is false, throw a TypeError.
             if (!value.isFunction())
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("import function must be callable"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("import function must be callable"), defaultSourceAppender, runtimeTypeForValue(value))));
             JSCell* cell = value.asCell();
             // ii. If v is an Exported Function Exotic Object:
             if (WebAssemblyFunction* importedExports = jsDynamicCast<WebAssemblyFunction*>(object)) {
@@ -135,24 +134,24 @@
             // 7. Otherwise (i is a table import):
             hasTableImport = true;
             JSWebAssemblyTable* table = jsDynamicCast<JSWebAssemblyTable*>(value);
-            // i. If v is not a WebAssembly.Table object, throw a WebAssembly.LinkError.
+            // i. If v is not a WebAssembly.Table object, throw a TypeError.
             if (!table)
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Table import is not an instance of WebAssembly.Table"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Table import is not an instance of WebAssembly.Table"))));
 
             uint32_t expectedInitial = moduleInformation.tableInformation.initial();
             uint32_t actualInitial = table->size();
             if (actualInitial < expectedInitial)
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Table import provided an 'initial' that is too small"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Table import provided an 'initial' that is too small"))));
 
             if (std::optional<uint32_t> expectedMaximum = moduleInformation.tableInformation.maximum()) {
                 std::optional<uint32_t> actualMaximum = table->maximum();
                 if (!actualMaximum) {
                     return JSValue::encode(
-                        throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Table import does not have a 'maximum' but the module requires that it does"))));
+                        throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Table import does not have a 'maximum' but the module requires that it does"))));
                 }
                 if (*actualMaximum > *expectedMaximum) {
                     return JSValue::encode(
-                        throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Imported Table's 'maximum' is larger than the module's expected 'maximum'"))));
+                        throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Imported Table's 'maximum' is larger than the module's expected 'maximum'"))));
                 }
             }
 
@@ -167,25 +166,25 @@
             RELEASE_ASSERT(moduleInformation.memory);
             hasMemoryImport = true;
             JSWebAssemblyMemory* memory = jsDynamicCast<JSWebAssemblyMemory*>(value);
-            // i. If v is not a WebAssembly.Memory object, throw a WebAssembly.LinkError.
+            // i. If v is not a WebAssembly.Memory object, throw a TypeError.
             if (!memory)
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Memory import is not an instance of WebAssembly.Memory"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Memory import is not an instance of WebAssembly.Memory"))));
 
             Wasm::PageCount expectedInitial = moduleInformation.memory.initial();
             Wasm::PageCount actualInitial = memory->memory()->initial();
             if (actualInitial < expectedInitial)
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Memory import provided an 'initial' that is too small"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Memory import provided an 'initial' that is too small"))));
 
             if (Wasm::PageCount expectedMaximum = moduleInformation.memory.maximum()) {
                 Wasm::PageCount actualMaximum = memory->memory()->maximum();
                 if (!actualMaximum) {
                     return JSValue::encode(
-                        throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Memory import did not have a 'maximum' but the module requires that it does"))));
+                        throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Memory import did not have a 'maximum' but the module requires that it does"))));
                 }
 
                 if (actualMaximum > expectedMaximum) {
                     return JSValue::encode(
-                        throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("Memory imports 'maximum' is larger than the module's expected 'maximum'"))));
+                        throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("Memory imports 'maximum' is larger than the module's expected 'maximum"))));
                 }
             }
             // ii. Append v to memories.
@@ -199,7 +198,7 @@
             ASSERT(moduleInformation.globals[import.kindIndex].mutability == Wasm::Global::Immutable);
             // ii. If Type(v) is not Number, throw a TypeError.
             if (!value.isNumber())
-                return JSValue::encode(throwException(exec, throwScope, createJSWebAssemblyLinkError(exec, &vm, ASCIILiteral("imported global must be a number"))));
+                return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("imported global must be a number"), defaultSourceAppender, runtimeTypeForValue(value))));
             // iii. Append ToWebAssemblyValue(v) to imports.
             switch (moduleInformation.globals[import.kindIndex].type) {
             case Wasm::I32:

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,102 +0,0 @@
-/*
- * 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 "WebAssemblyLinkErrorConstructor.h"
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "FunctionPrototype.h"
-#include "JSCInlines.h"
-#include "JSWebAssemblyLinkError.h"
-#include "WebAssemblyLinkErrorPrototype.h"
-
-#include "WebAssemblyLinkErrorConstructor.lut.h"
-
-namespace JSC {
-
-const ClassInfo WebAssemblyLinkErrorConstructor::s_info = { "Function", &Base::s_info, &constructorTableWebAssemblyLinkError, CREATE_METHOD_TABLE(WebAssemblyLinkErrorConstructor) };
-
-/* Source for WebAssemblyLinkErrorConstructor.lut.h
- @begin constructorTableWebAssemblyLinkError
- @end
- */
-
-static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyLinkError(ExecState* state)
-{
-    auto& vm = state->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    JSValue message = state->argument(0);
-    auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), asInternalFunction(state->jsCallee())->globalObject()->WebAssemblyLinkErrorStructure());
-    RETURN_IF_EXCEPTION(scope, encodedJSValue());
-    return JSValue::encode(JSWebAssemblyLinkError::create(state, &vm, structure, message));
-}
-
-static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyLinkError(ExecState* state)
-{
-    VM& vm = state->vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(state, scope, "WebAssembly.LinkError"));
-}
-
-WebAssemblyLinkErrorConstructor* WebAssemblyLinkErrorConstructor::create(VM& vm, Structure* structure, WebAssemblyLinkErrorPrototype* thisPrototype)
-{
-    auto* constructor = new (NotNull, allocateCell<WebAssemblyLinkErrorConstructor>(vm.heap)) WebAssemblyLinkErrorConstructor(vm, structure);
-    constructor->finishCreation(vm, thisPrototype);
-    return constructor;
-}
-
-Structure* WebAssemblyLinkErrorConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-{
-    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
-}
-
-void WebAssemblyLinkErrorConstructor::finishCreation(VM& vm, WebAssemblyLinkErrorPrototype* prototype)
-{
-    Base::finishCreation(vm, ASCIILiteral("LinkError"));
-    putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, ReadOnly | DontEnum | DontDelete);
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
-}
-
-WebAssemblyLinkErrorConstructor::WebAssemblyLinkErrorConstructor(VM& vm, Structure* structure)
-    : Base(vm, structure)
-{
-}
-
-ConstructType WebAssemblyLinkErrorConstructor::getConstructData(JSCell*, ConstructData& constructData)
-{
-    constructData.native.function = constructJSWebAssemblyLinkError;
-    return ConstructType::Host;
-}
-
-CallType WebAssemblyLinkErrorConstructor::getCallData(JSCell*, CallData& callData)
-{
-    callData.native.function = callJSWebAssemblyLinkError;
-    return CallType::Host;
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "InternalFunction.h"
-#include "JSObject.h"
-
-namespace JSC {
-
-class WebAssemblyLinkErrorPrototype;
-
-class WebAssemblyLinkErrorConstructor : public InternalFunction {
-public:
-    typedef InternalFunction Base;
-    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
-
-    static WebAssemblyLinkErrorConstructor* create(VM&, Structure*, WebAssemblyLinkErrorPrototype*);
-    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
-
-    DECLARE_INFO;
-
-protected:
-    void finishCreation(VM&, WebAssemblyLinkErrorPrototype*);
-
-private:
-    WebAssemblyLinkErrorConstructor(VM&, Structure*);
-    static ConstructType getConstructData(JSCell*, ConstructData&);
-    static CallType getCallData(JSCell*, CallData&);
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.cpp (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.cpp	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.cpp	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,69 +0,0 @@
-/*
- * 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 "WebAssemblyLinkErrorPrototype.h"
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "FunctionPrototype.h"
-#include "JSCInlines.h"
-
-#include "WebAssemblyLinkErrorPrototype.lut.h"
-
-namespace JSC {
-
-const ClassInfo WebAssemblyLinkErrorPrototype::s_info = { "WebAssembly.LinkError.prototype", &Base::s_info, &prototypeTableWebAssemblyLinkError, CREATE_METHOD_TABLE(WebAssemblyLinkErrorPrototype) };
-
-/* Source for WebAssemblyLinkErrorPrototype.lut.h
- @begin prototypeTableWebAssemblyLinkError
- @end
- */
-
-WebAssemblyLinkErrorPrototype* WebAssemblyLinkErrorPrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
-{
-    auto* object = new (NotNull, allocateCell<WebAssemblyLinkErrorPrototype>(vm.heap)) WebAssemblyLinkErrorPrototype(vm, structure);
-    object->finishCreation(vm);
-    return object;
-}
-
-Structure* WebAssemblyLinkErrorPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-{
-    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
-}
-
-void WebAssemblyLinkErrorPrototype::finishCreation(VM& vm)
-{
-    Base::finishCreation(vm);
-}
-
-WebAssemblyLinkErrorPrototype::WebAssemblyLinkErrorPrototype(VM& vm, Structure* structure)
-    : Base(vm, structure)
-{
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Deleted: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.h (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.h	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorPrototype.h	2017-01-11 01:22:21 UTC (rev 210568)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "JSDestructibleObject.h"
-#include "JSObject.h"
-
-namespace JSC {
-
-class WebAssemblyLinkErrorPrototype : public JSNonFinalObject {
-public:
-    typedef JSNonFinalObject Base;
-    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
-
-    static WebAssemblyLinkErrorPrototype* create(VM&, JSGlobalObject*, Structure*);
-    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
-
-    DECLARE_INFO;
-
-protected:
-    void finishCreation(VM&);
-
-private:
-    WebAssemblyLinkErrorPrototype(VM&, Structure*);
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)

Modified: branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyModuleRecord.cpp (210567 => 210568)


--- branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyModuleRecord.cpp	2017-01-11 01:02:34 UTC (rev 210567)
+++ branches/safari-603-branch/Source/_javascript_Core/wasm/js/WebAssemblyModuleRecord.cpp	2017-01-11 01:22:21 UTC (rev 210568)
@@ -33,7 +33,6 @@
 #include "JSLexicalEnvironment.h"
 #include "JSModuleEnvironment.h"
 #include "JSWebAssemblyInstance.h"
-#include "JSWebAssemblyLinkError.h"
 #include "JSWebAssemblyModule.h"
 #include "ProtoCallFrame.h"
 #include "WasmFormat.h"
@@ -196,9 +195,9 @@
 }
 
 template <typename Scope, typename N, typename ...Args>
-NEVER_INLINE static JSValue dataSegmentFail(ExecState* state, VM* vm, Scope& scope, N memorySize, N segmentSize, N offset, Args... args)
+NEVER_INLINE static JSValue dataSegmentFail(ExecState* state, Scope& scope, N memorySize, N segmentSize, N offset, Args... args)
 {
-    return throwException(state, scope, createJSWebAssemblyLinkError(state, vm, makeString(ASCIILiteral("Invalid data segment initialization: segment of "), String::number(segmentSize), ASCIILiteral(" bytes memory of "), String::number(memorySize), ASCIILiteral(" bytes, at offset "), String::number(offset), args...)));
+    return throwException(state, scope, createRangeError(state, makeString(ASCIILiteral("Invalid data segment initialization: segment of "), String::number(segmentSize), ASCIILiteral(" bytes memory of "), String::number(memorySize), ASCIILiteral(" bytes, at offset "), String::number(offset), args...)));
 }
 
 JSValue WebAssemblyModuleRecord::evaluate(ExecState* state)
@@ -222,7 +221,7 @@
             uint32_t tableIndex = element.offset;
             uint64_t lastWrittenIndex = static_cast<uint64_t>(tableIndex) + static_cast<uint64_t>(element.functionIndices.size()) - 1;
             if (lastWrittenIndex >= table->size())
-                return throwException(state, scope, createJSWebAssemblyLinkError(state, &vm, ASCIILiteral("Element is trying to set an out of bounds table index")));
+                return JSValue::decode(throwVMRangeError(state, scope, ASCIILiteral("Element is trying to set an out of bounds table index")));
 
             for (uint32_t i = 0; i < element.functionIndices.size(); ++i) {
                 // FIXME: This essentially means we're exporting an import.
@@ -262,9 +261,9 @@
             for (auto& segment : data) {
                 if (segment->sizeInBytes) {
                     if (UNLIKELY(sizeInBytes < segment->sizeInBytes))
-                        return dataSegmentFail(state, &vm, scope, sizeInBytes, segment->sizeInBytes, segment->offset, ASCIILiteral(", segment is too big"));
+                        return dataSegmentFail(state, scope, sizeInBytes, segment->sizeInBytes, segment->offset, ASCIILiteral(", segment is too big"));
                     if (UNLIKELY(segment->offset > sizeInBytes - segment->sizeInBytes))
-                        return dataSegmentFail(state, &vm, scope, sizeInBytes, segment->sizeInBytes, segment->offset, ASCIILiteral(", segment writes outside of memory"));
+                        return dataSegmentFail(state, scope, sizeInBytes, segment->sizeInBytes, segment->offset, ASCIILiteral(", segment writes outside of memory"));
                     memcpy(memory + segment->offset, &segment->byte(0), segment->sizeInBytes);
                 }
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to