Revert "Revert "Add concurrent card graying for immune spaces""

Added an additional checkpoint before the concurrent graying to set
the mark entrypoints to non-null.

Bug: 37876887

Test: test-art-host

This reverts commit c83dd7bfde2171c879efb92a31a363505385ffb9.

Change-Id: I961c4631c9595c52cd7765f61b22b8291fef2088
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 2e0d866..0f3f367 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -1387,13 +1387,14 @@
   CHECK(!Contains(self));
   list_.push_back(self);
   if (kUseReadBarrier) {
+    gc::collector::ConcurrentCopying* const cc =
+        Runtime::Current()->GetHeap()->ConcurrentCopyingCollector();
     // Initialize according to the state of the CC collector.
-    bool is_gc_marking =
-        Runtime::Current()->GetHeap()->ConcurrentCopyingCollector()->IsMarking();
-    self->SetIsGcMarkingAndUpdateEntrypoints(is_gc_marking);
-    bool weak_ref_access_enabled =
-        Runtime::Current()->GetHeap()->ConcurrentCopyingCollector()->IsWeakRefAccessEnabled();
-    self->SetWeakRefAccessEnabled(weak_ref_access_enabled);
+    self->SetIsGcMarkingAndUpdateEntrypoints(cc->IsMarking());
+    if (cc->IsUsingReadBarrierEntrypoints()) {
+      self->SetReadBarrierEntrypoints();
+    }
+    self->SetWeakRefAccessEnabled(cc->IsWeakRefAccessEnabled());
   }
 }