WebAssembly API: implement WebAssembly.LinkError
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Dec 2016 20:20:05 +0000 (20:20 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Dec 2016 20:20:05 +0000 (20:20 +0000)
commitc6eccbd1b7f4bf2d81261b31cfd42d09797ba106
tree928777696b3e0b9ee51a119c01614b95deb7caf5
parentebfb318c503941371e304be07639b01bc5373035
WebAssembly API: implement WebAssembly.LinkError
https://bugs.webkit.org/show_bug.cgi?id=165805
<rdar://problem/29747874>

JSTests:

Reviewed by Mark lam.

Update all exception sites which now throw WebAssembly.LinkError.

* wasm/js-api/element-data.js:
* wasm/js-api/element.js:
(assert.throws):
* wasm/js-api/global-error.js:
(new.Number):
* wasm/js-api/table.js:
(assert.throws):
(new.WebAssembly.Table):
* wasm/js-api/test_Data.js:
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):
* wasm/js-api/test_memory.js:
(test):
(test.testMemImportError): Deleted.

Source/JavaScriptCore:

Reviewed by Mark Lam.

As described here: https://github.com/WebAssembly/design/pull/901
Some TypeError and RangeError are now converted to WebAssembly.LinkError.

* CMakeLists.txt: add files
* DerivedSources.make: add autoget .lut.h files
* JavaScriptCore.xcodeproj/project.pbxproj: add files
* builtins/BuiltinNames.h: new name LinkError
* runtime/JSGlobalObject.h: auto-register LinkError using existing macro magic
* wasm/JSWebAssembly.h: make the new includes available
* wasm/js/JSWebAssemblyLinkError.cpp: Copied from Source/JavaScriptCore/wasm/JSWebAssemblyCompileError.cpp.
(JSC::JSWebAssemblyLinkError::create):
(JSC::JSWebAssemblyLinkError::JSWebAssemblyLinkError):
(JSC::createWebAssemblyLinkError):
* wasm/js/JSWebAssemblyLinkError.h: Copied from Source/JavaScriptCore/wasm/JSWebAssemblyCompileError.h.
(JSC::JSWebAssemblyLinkError::create):
* wasm/js/WebAssemblyInstanceConstructor.cpp: update as per spec change
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyLinkErrorConstructor.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyCompileErrorConstructor.cpp.
(JSC::constructJSWebAssemblyLinkError):
(JSC::callJSWebAssemblyLinkError):
(JSC::WebAssemblyLinkErrorConstructor::create):
(JSC::WebAssemblyLinkErrorConstructor::createStructure):
(JSC::WebAssemblyLinkErrorConstructor::finishCreation):
(JSC::WebAssemblyLinkErrorConstructor::WebAssemblyLinkErrorConstructor):
(JSC::WebAssemblyLinkErrorConstructor::getConstructData):
(JSC::WebAssemblyLinkErrorConstructor::getCallData):
* wasm/js/WebAssemblyLinkErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyCompileErrorConstructor.h.
* wasm/js/WebAssemblyLinkErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyCompileErrorPrototypr.cpp.
(JSC::WebAssemblyLinkErrorPrototype::create):
(JSC::WebAssemblyLinkErrorPrototype::createStructure):
(JSC::WebAssemblyLinkErrorPrototype::finishCreation):
(JSC::WebAssemblyLinkErrorPrototype::WebAssemblyLinkErrorPrototype):
* wasm/js/WebAssemblyLinkErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyCompileErrorPrototypr.h.
* wasm/js/WebAssemblyModuleRecord.cpp: update as per spec change
(JSC::dataSegmentFail):
(JSC::WebAssemblyModuleRecord::evaluate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
JSTests/ChangeLog
JSTests/wasm/js-api/element-data.js
JSTests/wasm/js-api/element.js
JSTests/wasm/js-api/global-error.js
JSTests/wasm/js-api/table.js
JSTests/wasm/js-api/test_Data.js
JSTests/wasm/js-api/test_basic_api.js
JSTests/wasm/js-api/test_memory.js
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/wasm/JSWebAssembly.h
Source/JavaScriptCore/wasm/js/JSWebAssemblyLinkError.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyLinkError.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorConstructor.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorConstructor.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp