Commit ff5bb7e5 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Cleanup: Use std::atomic<T> instead of base::AtomicNumber<T> in concurrent marker.

Bug: chromium:842083
Change-Id: I4ce2b58aa7fcafe7e886a3c80d3ddf7bfe3e4415
Reviewed-on: https://chromium-review.googlesource.com/1055389
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53120}
parent ace19221
......@@ -577,7 +577,7 @@ void ConcurrentMarking::Run(int task_id, TaskState* task_state) {
weak_objects_->transition_arrays.FlushToGlobal(task_id);
weak_objects_->weak_references.FlushToGlobal(task_id);
base::AsAtomicWord::Relaxed_Store<size_t>(&task_state->marked_bytes, 0);
total_marked_bytes_.Increment(marked_bytes);
total_marked_bytes_ += marked_bytes;
{
base::LockGuard<base::Mutex> guard(&pending_lock_);
is_pending_[task_id] = false;
......@@ -687,7 +687,7 @@ void ConcurrentMarking::FlushLiveBytes(
live_bytes.clear();
task_state_[i].marked_bytes = 0;
}
total_marked_bytes_.SetValue(0);
total_marked_bytes_ = 0;
}
void ConcurrentMarking::ClearLiveness(MemoryChunk* chunk) {
......@@ -704,7 +704,7 @@ size_t ConcurrentMarking::TotalMarkedBytes() {
result +=
base::AsAtomicWord::Relaxed_Load<size_t>(&task_state_[i].marked_bytes);
}
result += total_marked_bytes_.Value();
result += total_marked_bytes_;
return result;
}
......
......@@ -101,7 +101,7 @@ class ConcurrentMarking {
MarkingWorklist* const on_hold_;
WeakObjects* const weak_objects_;
TaskState task_state_[kMaxTasks + 1];
base::AtomicNumber<size_t> total_marked_bytes_{0};
std::atomic<size_t> total_marked_bytes_{0};
base::Mutex pending_lock_;
base::ConditionVariable pending_condition_;
int pending_task_count_ = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment