[webkit-changes] [WebKit/WebKit] 602054: Fix wasm->JS when useJIT=0
Daniel Liu
noreply at github.com
Wed Dec 18 15:30:07 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 602054ed517608e2babeb5091d17be16abb0f155
https://github.com/WebKit/WebKit/commit/602054ed517608e2babeb5091d17be16abb0f155
Author: Daniel Liu <danlliu at umich.edu>
Date: 2024-12-18 (Wed, 18 Dec 2024)
Changed paths:
M JSTests/wasm/gc/bug254413.js
M JSTests/wasm/gc/bug254414.js
M JSTests/wasm/gc/bug258127.js
M JSTests/wasm/gc/bug258128.js
M JSTests/wasm/gc/bug258795.js
M JSTests/wasm/gc/bug258796.js
M JSTests/wasm/stress/armv7-simple-loop-osr.js
M JSTests/wasm/stress/simd-const-relaxed-lane-select.js
M JSTests/wasm/stress/simd-global.js
M JSTests/wasm/stress/tail-call-should-not-clobber-caller-origin.js
M JSTests/wasm/stress/try-and-block-with-v128-results.js
M JSTests/wasm/stress/try-table-malformed-catch-label.js
M Source/JavaScriptCore/llint/WebAssembly.asm
M Source/JavaScriptCore/runtime/Options.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBinding.cpp
M Source/JavaScriptCore/wasm/WasmFormat.h
M Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmOperations.cpp
M Source/JavaScriptCore/wasm/WasmOperations.h
M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmTable.cpp
M Source/JavaScriptCore/wasm/WasmTable.h
M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h
M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
M Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.cpp
M Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.h
M Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
M Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp
M Tools/Scripts/run-jsc-stress-tests
Log Message:
-----------
Fix wasm->JS when useJIT=0
https://bugs.webkit.org/show_bug.cgi?id=281512
rdar://138422560
Reviewed by Yusuke Suzuki.
This patch fixes https://github.com/WebKit/WebKit/pull/35232,
and consolidates those patches together. The major code changes were made by
Justin Michaud.
1) Generally clean up this code, and remove magic numbers
2) Ensure that the Callee stack slot is always a boxed callee; This did
not seem to break any tests somehow, but it would be wrong when we
try to unwind.
3) Abstract both an imported JS or wasm function, or a function in a table
into a WasmCallableFunction, and pass that from LLint to LLInt calls.
The JIT case does not need this.
This should fix the last remaining ARMv7 test failure, although this feature
in particular is broken on all platforms.
This patch cleans up the ~80 test failures in `--jitless-wasm` test mode.
Some of these failures were due to GC tests that should not be running, which have
been disabled. The key fixes involve:
- Fixing where wasm_to_js_wrapper_entry loads its WasmCallableFunction*
- Fixing a conflict in tail calls where the WasmCallableFunction* would get
overwritten by another register being saved in the CodeBlock slot
- Update the WasmToJSExit operations to use the WasmCallableFunction*, and
fixing some cases where properties of the WasmCallableFunction wouldn't
be set properly.
* JSTests/wasm/gc/bug254413.js:
* JSTests/wasm/gc/bug254414.js:
* JSTests/wasm/gc/bug258127.js:
* JSTests/wasm/gc/bug258128.js:
* JSTests/wasm/stress/simd-global.js:
* JSTests/wasm/stress/try-and-block-with-v128-results.js:
* JSTests/wasm/stress/try-table-malformed-catch-label.js:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::Options::notifyOptionsChanged):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::emitTailCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallIndirect):
* Source/JavaScriptCore/wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::WasmCallableFunction::offsetOfEntrypointLoadLocation):
(JSC::Wasm::WasmCallableFunction::offsetOfBoxedWasmCalleeLoadLocation):
(JSC::Wasm::WasmToWasmImportableFunction::offsetOfSignatureIndex):
(JSC::Wasm::WasmToWasmImportableFunction::offsetOfEntrypointLoadLocation): Deleted.
(JSC::Wasm::WasmToWasmImportableFunction::offsetOfBoxedWasmCalleeLoadLocation): Deleted.
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp:
(JSC::IPInt::doWasmCall):
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_NOEXCEPT_JIT_OPERATION):
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmOperations.h:
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::doWasmCall):
(JSC::LLInt::doWasmCallIndirect):
(JSC::LLInt::doWasmCallRef):
* Source/JavaScriptCore/wasm/WasmTable.cpp:
(JSC::Wasm::FuncRefTable::setFunction):
* Source/JavaScriptCore/wasm/WasmTable.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::~JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finalizeCreation):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::WebAssemblyFunction):
* Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.cpp:
(JSC::WebAssemblyFunctionBase::WebAssemblyFunctionBase):
* Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.h:
(JSC::WebAssemblyFunctionBase::importableFunction const):
* Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::initializeImports):
* Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::WebAssemblyWrapperFunction):
(JSC::WebAssemblyWrapperFunction::create):
Canonical link: https://commits.webkit.org/288046@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list