Do read barriers on native roots in CopyClassVisitor

Fixes a race condition caused by making a copy of a class then
clearing the native root arrays of the original class. If the
original class was gray and the new class was black then the GC
would miss the native roots.

Bug: 22957957

Change-Id: I706110018220af12a2ad0d72eb803f1cfe3580b9
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 7821da3..48dc88d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -4063,10 +4063,10 @@
     // Retire the temporary class and create the correctly sized resolved class.
     StackHandleScope<1> hs(self);
     auto h_new_class = hs.NewHandle(klass->CopyOf(self, class_size, imt, image_pointer_size_));
-    // Set array lengths to 0 since we don't want the GC to visit two different classes with the
-    // same ArtFields with the same If this occurs, it causes bugs in remembered sets since the GC
-    // may not see any references to the from space and clean the card. Though there was references
-    // to the from space that got marked by the first class.
+    // Set arrays to null since we don't want to have multiple classes with the same ArtField or
+    // ArtMethod array pointers. If this occurs, it causes bugs in remembered sets since the GC
+    // may not see any references to the target space and clean the card for a class if another
+    // class had the same array pointer.
     klass->SetDirectMethodsPtrUnchecked(nullptr);
     klass->SetVirtualMethodsPtr(nullptr);
     klass->SetSFieldsPtrUnchecked(nullptr);