WebAssembly JS API: implement basic stub
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 21:36:05 +0000 (21:36 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 21:36:05 +0000 (21:36 +0000)
commit80d09c1ec0372c39cb191838a5db432e61523fa8
tree073bdd8f8fc85794ba9992178a30d739c9a36356
parent8e893f723170299418371dd8131b5df650df55e8
WebAssembly JS API: implement basic stub

Implement the global WebAssembly JavaScript object, and its constructor +
function properties as described in:
  https://github.com/WebAssembly/design/blob/master/JS.md

These don't do anything at the moment, the parent bug will take care of adding
more functionality and associated tests.

WebAssembly JS API: implement basic stub
https://bugs.webkit.org/show_bug.cgi?id=163404

Reviewed by Keith Miller.

JSTests:

* wasm.yaml:
* wasm/js-api/test_basic_api.js: Added.
(const.f.of.functionProperties.WebAssembly.f.undefined.throw.new.Error.Couldn.const.c.of.constructorProperties.WebAssembly.c.undefined.throw.new.Error.Couldn):
(const.c.of.constructorProperties.catch):

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h: register the new WebAssembly object's name and its constructor properties
* jsc.cpp: remove useless include
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): add the WebAssembly global object and its constructor properties, but only if the JSC option enables it
* runtime/Options.h: add the useWebAssembly (alias: enableWebAssembly) option, defaulting to false
* wasm/WebAssemblyObject.cpp: Added.
(JSC::WebAssemblyObject::create): boilerplate
(JSC::WebAssemblyObject::createStructure): boilerplate
(JSC::WebAssemblyObject::finishCreation): boilerplate
(JSC::WebAssemblyObject::WebAssemblyObject): boilerplate
(JSC::wasmObjectFuncvalidate): auto-throws for now
(JSC::wasmObjectFunccompile): auto-throws for now
* wasm/WebAssemblyObject.h: Added.

Tools:

* Scripts/run-jsc-stress-tests: use the new JSC option which exposes the WebAssembly object.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
JSTests/ChangeLog
JSTests/wasm.yaml
JSTests/wasm/js-api/test_basic_api.js [new file with mode: 0644]
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/Options.h
Source/JavaScriptCore/wasm/WebAssemblyObject.cpp [new file with mode: 0644]
Source/JavaScriptCore/wasm/WebAssemblyObject.h [new file with mode: 0644]
Tools/ChangeLog
Tools/Scripts/run-jsc-stress-tests