Use std::atomic for CodeBlock::m_visitAggregateHasBeenCalled.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Mar 2015 22:14:32 +0000 (22:14 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Mar 2015 22:14:32 +0000 (22:14 +0000)
commite26867b7bbc89869c9cf4b539b465f0804cf69e7
treed5cc12c115735fdfd2de0bd54087ab2dc885ed0e
parentf871cd451af6ea2a7626997b5eb0d4831c0e0bac
Use std::atomic for CodeBlock::m_visitAggregateHasBeenCalled.
<https://webkit.org/b/142640>

Reviewed by Mark Hahnenberg.

We used to spin our own compare and swap on a uint8_t.  Now that we can
use C++11, let's use std::atomic instead.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitAggregate):
- The CAS here needs std::memory_order_acquire ordering because it
  requires lock acquisition semantics to visit the CodeBlock.

* bytecode/CodeBlock.h:
(JSC::CodeBlockSet::mark):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::clearMarksForFullCollection):
(JSC::CodeBlockSet::clearMarksForEdenCollection):
- These can go with relaxed ordering because they are all done before
  the GC starts parallel marking.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/heap/CodeBlockSet.cpp