Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r181481 - Introduce WTF::Atomic to wrap std::atomic for a frien…
…dlier CAS. <https://webkit.org/b/142661> Reviewed by Filip Pizlo. Source/JavaScriptCore: Changed CodeBlock, and the DFG's crashLock to use WTF::Atomic instead of std::atomic. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::visitAggregate): * bytecode/CodeBlock.h: * dfg/DFGCommon.cpp: (JSC::DFG::startCrashing): Source/WTF: The CAS functions provided by std::atomic takes a reference to the expected value and modifies it if the CAS fails. However, in a lot of our CAS usage, we don't want the expected value to change. The solution to this is to provide a WTF::Atomic struct that wraps std::atomic, and provide CAS methods that won't alter the expected value if the CAS fails. The method names in WTF::Atomic are chosen to be identical to those in std::atomic so that WTF::Atomic can be a simple drop in replacement for std::atomic. Also changed ByteSpinLock to use WTF::Atomic instead of std::atomic. * wtf/Atomics.h: (WTF::Atomic::load): (WTF::Atomic::store): (WTF::Atomic::compare_exchange_weak): (WTF::Atomic::compare_exchange_strong): * wtf/ByteSpinLock.h: (WTF::ByteSpinLock::ByteSpinLock): (WTF::ByteSpinLock::lock):
- Loading branch information
1 parent
4842c61
commit 5db62d1
Showing
7 changed files
with
91 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters