diff options
author | 2018-06-28 12:00:56 +0100 | |
---|---|---|
committer | 2018-08-14 18:01:43 +0100 | |
commit | 14e5a29a8c5dcd971376a4a04b3c3b05100b3f86 (patch) | |
tree | 81c607cde36b6481ed2cd2d8b41293f62a5521f8 /runtime/gc/reference_queue.cc | |
parent | e0943873483cb2169e5360e1f746931a3371aa24 (diff) |
Rename art::ReadBarrier::WhiteState as art::ReadBarrier::NonGrayState.
The read barrier state recorded in object's lockword used to be a
three-state value (white/gray/black), which was turned into a
two-state value (white/gray), where the "black" state was conceptually
merged into the "white" state. This change renames the "white" state
as "non-gray" and adjusts corresponding comments.
Test: art/test.py
Change-Id: I2a17ed15651bdbbe99270c1b81b4d78a1c2c132b
Diffstat (limited to 'runtime/gc/reference_queue.cc')
-rw-r--r-- | runtime/gc/reference_queue.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/gc/reference_queue.cc b/runtime/gc/reference_queue.cc index 321d22a592..e25e279ea6 100644 --- a/runtime/gc/reference_queue.cc +++ b/runtime/gc/reference_queue.cc @@ -76,19 +76,19 @@ void ReferenceQueue::DisableReadBarrierForReference(ObjPtr<mirror::Reference> re Heap* heap = Runtime::Current()->GetHeap(); if (kUseBakerOrBrooksReadBarrier && heap->CurrentCollectorType() == kCollectorTypeCC && heap->ConcurrentCopyingCollector()->IsActive()) { - // Change the gray ptr we left in ConcurrentCopying::ProcessMarkStackRef() to white. + // Change the gray ptr we left in ConcurrentCopying::ProcessMarkStackRef() to non-gray. // We check IsActive() above because we don't want to do this when the zygote compaction // collector (SemiSpace) is running. CHECK(ref != nullptr); collector::ConcurrentCopying* concurrent_copying = heap->ConcurrentCopyingCollector(); uint32_t rb_state = ref->GetReadBarrierState(); if (rb_state == ReadBarrier::GrayState()) { - ref->AtomicSetReadBarrierState(ReadBarrier::GrayState(), ReadBarrier::WhiteState()); - CHECK_EQ(ref->GetReadBarrierState(), ReadBarrier::WhiteState()); + ref->AtomicSetReadBarrierState(ReadBarrier::GrayState(), ReadBarrier::NonGrayState()); + CHECK_EQ(ref->GetReadBarrierState(), ReadBarrier::NonGrayState()); } else { - // In ConcurrentCopying::ProcessMarkStackRef() we may leave a white reference in the queue and - // find it here, which is OK. - CHECK_EQ(rb_state, ReadBarrier::WhiteState()) << "ref=" << ref << " rb_state=" << rb_state; + // In ConcurrentCopying::ProcessMarkStackRef() we may leave a non-gray reference in the queue + // and find it here, which is OK. + CHECK_EQ(rb_state, ReadBarrier::NonGrayState()) << "ref=" << ref << " rb_state=" << rb_state; ObjPtr<mirror::Object> referent = ref->GetReferent<kWithoutReadBarrier>(); // The referent could be null if it's cleared by a mutator (Reference.clear()). if (referent != nullptr) { |