Atomics on ARM don't require full-system fencing, and other minutiae
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2016 18:51:26 +0000 (18:51 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Sep 2016 18:51:26 +0000 (18:51 +0000)
commit6767e343837ed0c19acbd617ad6ba3d3efced546
treeb6477dbe4f1d328882408a837749386fad170c93
parentf412001f123cd5688b8590e1afaa5c866461b33b
Atomics on ARM don't require full-system fencing, and other minutiae
https://bugs.webkit.org/show_bug.cgi?id=161928

Reviewed by Geoffrey Garen.

Add cmpxchg versions with both success and failure memory
ordering. In some interesting cases we can craft code which needs
barriers which aren't as strong.

weakCompareAndSwap is super dubious, its 3 uses seem
questionable... but for now I'm just adding debug asserts.

Rename armv7_dmb* functions to arm_dmb* because they apply to v7
and v8 (or more precisely; to ARMv7's ARM and Thumb2, as well as
ARMv8's aarch32 A32/T32 and aarch64).

Use inner-shareability domain for ARM barriers instead of
full-system. This is what C++ uses.

The default case for barriers simply used a compiler barrier. This
is generally wrong, e.g. for MIPS.

* wtf/Atomics.h:
(WTF::Atomic::compareExchangeWeak): offer two-order version
(WTF::Atomic::compareExchangeStrong): offer two-order version
(WTF::weakCompareAndSwap): a few assertions
(WTF::arm_dmb): rename since it applies to ARMv7 and v8; make it innser-shareable
(WTF::arm_dmb_st): rename since it applies to ARMv7 and v8; make it innser-shareable
(WTF::loadLoadFence): incorrect generally
(WTF::loadStoreFence): incorrect generally
(WTF::storeLoadFence): incorrect generally
(WTF::storeStoreFence): incorrect generally
(WTF::memoryBarrierAfterLock): incorrect generally
(WTF::memoryBarrierBeforeUnlock): incorrect generally
(WTF::armV7_dmb): Deleted.
(WTF::armV7_dmb_st): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/Atomics.h