[WebAssembly][Modules] Import tables in wasm modules
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2018 17:55:15 +0000 (17:55 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2018 17:55:15 +0000 (17:55 +0000)
commit5f8f1ee0204400c32d43413ede7f1b7bceb130ac
tree8a18f9d2bb0aa83b814fafc581ea35f09796b6b6
parent49eb0a95aacfcde2c7772a455fcfcb4f977a6e21
[WebAssembly][Modules] Import tables in wasm modules
https://bugs.webkit.org/show_bug.cgi?id=184738

Reviewed by JF Bastien.

JSTests:

* wasm/modules/wasm-imports-js-re-exports-wasm-exports.js:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wasm:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/re-export.js:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wasm:
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat:
* wasm/modules/wasm-imports-wasm-exports.js:
* wasm/modules/wasm-imports-wasm-exports/imports.wasm:
* wasm/modules/wasm-imports-wasm-exports/imports.wat:
* wasm/modules/wasm-imports-wasm-exports/sum.wasm:
* wasm/modules/wasm-imports-wasm-exports/sum.wat:

Source/JavaScriptCore:

This patch simply allows wasm modules to import table from wasm modules / js re-exporting.
Basically moving JSWebAssemblyInstance's table linking code to WebAssemblyModuleRecord::link
just works.

* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
JSTests/ChangeLog
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports.js
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wasm
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/re-export.js
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wasm
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat
JSTests/wasm/modules/wasm-imports-wasm-exports.js
JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wasm
JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat
JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wasm
JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp