WebAssembly: We should only create wrappers for functions that can be exported
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 19:13:53 +0000 (19:13 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 19:13:53 +0000 (19:13 +0000)
commita526300368a5c0d1adcb90a97345a971d14b3209
tree42455cb7557892f2c15612ab6a531bb9bf8a0116
parent5e279a4db10177e42f930f814f520d1f636bdec3
WebAssembly: We should only create wrappers for functions that can be exported
https://bugs.webkit.org/show_bug.cgi?id=173088

Reviewed by Saam Barati.

JSTests:

Remove a bunch of old tests that are actually duplicates of the spec-tests and rely
on the old testWasmModuleFunctions api, which has been removed.

* wasm/function-tests/copysign.js: Removed.
* wasm/function-tests/ctz.js: Removed.
* wasm/function-tests/drop.js: Removed.
* wasm/function-tests/dumb-eq-if-then-else.js: Removed.
* wasm/function-tests/dumb-less-than-fallthrough.js: Removed.
* wasm/function-tests/dumb-less-than-ite.js: Removed.
* wasm/function-tests/eqz.js: Removed.
* wasm/function-tests/i32-trunc-s-f32.js: Removed.
* wasm/function-tests/i32-trunc-s-f64.js: Removed.
* wasm/function-tests/i32-trunc-u-f32.js: Removed.
* wasm/function-tests/i32-trunc-u-f64.js: Removed.
* wasm/function-tests/i64-trunc-s-f32.js: Removed.
* wasm/function-tests/i64-trunc-s-f64.js: Removed.
* wasm/function-tests/i64-trunc-u-f32.js: Removed.
* wasm/function-tests/i64-trunc-u-f64.js: Removed.
* wasm/function-tests/if-then-else-fallthrough.js: Removed.
* wasm/function-tests/if-then-fallthrough.js: Removed.
* wasm/function-tests/int-to-floating-point.js: Removed.
* wasm/function-tests/loop-mult.js:
* wasm/function-tests/loop-sum.js:
* wasm/function-tests/max.js: Removed.
* wasm/function-tests/min.js: Removed.
* wasm/function-tests/nearest.js: Removed.
* wasm/function-tests/nop.js: Removed.
* wasm/function-tests/popcnt.js: Removed.
* wasm/function-tests/ret5.js:
* wasm/function-tests/select.js: Removed.
* wasm/function-tests/tee-local.js: Removed.
* wasm/function-tests/trunc.js: Removed.

Source/JavaScriptCore:

This patch makes it so we only create wrappers for WebAssembly functions that
can actually be exported. It appears to be a ~2.5% speedup on WasmBench compile times.

This patch also removes most of the old testWasmModuleFunctions api from the jsc CLI.
Most of the tests were duplicates of ones in the spec-tests directory. The others I
have converted to use the normal API.

* jsc.cpp:
(GlobalObject::finishCreation):
(valueWithTypeOfWasmValue): Deleted.
(box): Deleted.
(callWasmFunction): Deleted.
(functionTestWasmModuleFunctions): Deleted.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::prepare):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::CodeBlock):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmFormat.h:
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):

Tools:

Add quick mode for wasm tests.

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
JSTests/ChangeLog
JSTests/wasm/function-tests/copysign.js [deleted file]
JSTests/wasm/function-tests/ctz.js [deleted file]
JSTests/wasm/function-tests/drop.js [deleted file]
JSTests/wasm/function-tests/dumb-eq-if-then-else.js [deleted file]
JSTests/wasm/function-tests/dumb-less-than-fallthrough.js [deleted file]
JSTests/wasm/function-tests/dumb-less-than-ite.js [deleted file]
JSTests/wasm/function-tests/eqz.js [deleted file]
JSTests/wasm/function-tests/i32-trunc-s-f32.js [deleted file]
JSTests/wasm/function-tests/i32-trunc-s-f64.js [deleted file]
JSTests/wasm/function-tests/i32-trunc-u-f32.js [deleted file]
JSTests/wasm/function-tests/i32-trunc-u-f64.js [deleted file]
JSTests/wasm/function-tests/i64-trunc-s-f32.js [deleted file]
JSTests/wasm/function-tests/i64-trunc-s-f64.js [deleted file]
JSTests/wasm/function-tests/i64-trunc-u-f32.js [deleted file]
JSTests/wasm/function-tests/i64-trunc-u-f64.js [deleted file]
JSTests/wasm/function-tests/if-then-else-fallthrough.js [deleted file]
JSTests/wasm/function-tests/if-then-fallthrough.js [deleted file]
JSTests/wasm/function-tests/int-to-floating-point.js [deleted file]
JSTests/wasm/function-tests/loop-mult.js
JSTests/wasm/function-tests/loop-sum.js
JSTests/wasm/function-tests/max.js [deleted file]
JSTests/wasm/function-tests/min.js [deleted file]
JSTests/wasm/function-tests/nearest.js [deleted file]
JSTests/wasm/function-tests/nop.js [deleted file]
JSTests/wasm/function-tests/popcnt.js [deleted file]
JSTests/wasm/function-tests/ret5.js
JSTests/wasm/function-tests/select.js [deleted file]
JSTests/wasm/function-tests/tee-local.js [deleted file]
JSTests/wasm/function-tests/trunc.js [deleted file]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
Source/JavaScriptCore/wasm/WasmB3IRGenerator.h
Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
Source/JavaScriptCore/wasm/WasmBBQPlan.h
Source/JavaScriptCore/wasm/WasmBBQPlanInlines.h
Source/JavaScriptCore/wasm/WasmCodeBlock.cpp
Source/JavaScriptCore/wasm/WasmCodeBlock.h
Source/JavaScriptCore/wasm/WasmFormat.h
Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
Tools/ChangeLog
Tools/Scripts/run-jsc-stress-tests