WebAssembly: fix misc JS API implementation inconsistencies
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 07:16:27 +0000 (07:16 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 07:16:27 +0000 (07:16 +0000)
commit29294a3d4105c6e4ac6b4140258769a6c03c074c
tree9a54d602789885e84004bef1deba48629aa54024
parentd11069ea8a406ee1ed8052137a5279c9e214543b
WebAssembly: fix misc JS API implementation inconsistencies
https://bugs.webkit.org/show_bug.cgi?id=170187

Reviewed by Keith Miller.

JSTests:

Verify that WebAssembly function are on the object's __proto__.

* wasm/js-api/Module-compile.js:
* wasm/js-api/validate.js:
* wasm/js-api/web-assembly-instantiate.js:

Source/JavaScriptCore:

Auto-generate lookup tables.
Methods should be on prototype.
Exception returns should be idiomatic.

* wasm/JSWebAssembly.cpp: validate / compile / instantiate should
be on the prototype
(JSC::JSWebAssembly::create):
(JSC::JSWebAssembly::finishCreation):
(JSC::reject): Deleted.
(JSC::webAssemblyCompileFunc): Deleted.
(JSC::resolve): Deleted.
(JSC::instantiate): Deleted.
(JSC::compileAndInstantiate): Deleted.
(JSC::webAssemblyInstantiateFunc): Deleted.
(JSC::webAssemblyValidateFunc): Deleted.
* wasm/JSWebAssembly.h:
* wasm/js/WebAssemblyMemoryPrototype.cpp: move from JSWebAssembly.cpp
(JSC::webAssemblyMemoryProtoFuncBuffer):
(JSC::WebAssemblyMemoryPrototype::create):
(JSC::WebAssemblyMemoryPrototype::finishCreation):
* wasm/js/WebAssemblyMemoryPrototype.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::reject):
(JSC::webAssemblyCompileFunc):
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
(JSC::webAssemblyFunctionValidate): Deleted.
(JSC::webAssemblyFunctionCompile): Deleted.
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::webAssemblyTableProtoFuncGrow):
(JSC::webAssemblyTableProtoFuncGet):
(JSC::webAssemblyTableProtoFuncSet):
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::finishCreation):
* wasm/js/WebAssemblyTablePrototype.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
JSTests/ChangeLog
JSTests/wasm/js-api/Module-compile.js
JSTests/wasm/js-api/validate.js
JSTests/wasm/js-api/web-assembly-instantiate.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/JSWebAssembly.cpp
Source/JavaScriptCore/wasm/JSWebAssembly.h
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h
Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.h