You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e1bfd55
Browse filesBrowse the repository at this point in the historyBrowse files
[Wasm] BBQ and OMG should compile atomic loads and stores in the same way as IPInt
https://bugs.webkit.org/show_bug.cgi?id=327931
Reviewed by Yusuke Suzuki.
On x86_64, sequentially consistent loads and stores can be compiled either to
(mov, xchg) or to (lock xadd, mov), but all tiers have to agree on which one.
Currently they do not.
IPInt: load = mov, store = xchg
BBQ: load = lock xadd, store = mov
OMG: load = lock xadd, store = xchg
So an atomic load in IPInt can be reordered before an earlier atomic store in
BBQ on the same thread.
This patch makes BBQ and OMG follow IPInt: xchg for atomic stores, and a plain
load on x86_64 and ldar on ARM64 for atomic loads.
Tests: JSTests/wasm/stress/atomic-load-is-not-moved-by-the-compiler.js
JSTests/wasm/stress/atomic-load-zero-extends.js
JSTests/wasm/stress/atomic-store-keeps-value-local.js
JSTests/wasm/stress/atomic-store-then-load-is-sequentially-consistent.js
* JSTests/wasm/stress/atomic-store-keeps-value-local.js: Added.
(const.wat.module):
* JSTests/wasm/stress/atomic-store-then-load-is-sequentially-consistent.js: Added.
(id.agent.start.import.string_appeared_here.then.):
(id.agent.start.import.string_appeared_here.then):
(id.async error):
* Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::emitAtomicStoreOp):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitAtomicLoadOp):
* JSTests/wasm/stress/atomic-load-is-not-moved-by-the-compiler.js: Added.
(agent.start.262.agent.receiveBroadcast):
* JSTests/wasm/stress/atomic-load-zero-extends.js: Added.
(const.wat.module.memory):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp:
(JSC::Wasm::OMGIRGenerator::emitAtomicLoadOp):
Canonical link: https://commits.webkit.org/324185@main
0 commit comments