Refactor the "is incremental marking" counter into an "entry flag" class.

1. Switch to <atomic>, which is the future of atomics in Blink.

2. Since this logic is subtle, it is factored out into a separate class
   with a verbose comment, explaining why its semantics are correct.

3. Since the load didn't previously synchronize with the store, and the
   only requirement a thread has is that it sees its own writes (and the
   data doesn't become corrupt), std::memory_order_relaxed is used for
   all accesses.

Bug: 736037
Change-Id: I017da1ebfba3e95e5d0393014dc57fb4958bd6b1
Reviewed-on: https://chromium-review.googlesource.com/c/1364151
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614340}
4 files changed