Merge "Change VisitNativeRoots to use unchecked get for method arrays"
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 15f2887..fc27315 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -838,12 +838,13 @@
   // In this case, it is safe to avoid marking the roots since we must be either the CC or CMS. If
   // we are CMS then the roots are already marked through other sources, otherwise the roots are
   // already marked due to the to-space invariant.
-  if (GetDirectMethodsPtr() != nullptr) {
+  // Unchecked versions since we may visit roots of classes that aren't yet loaded.
+  if (GetDirectMethodsPtrUnchecked() != nullptr) {
     for (auto& m : GetDirectMethods(pointer_size)) {
       m.VisitRoots(visitor);
     }
   }
-  if (GetVirtualMethodsPtr() != nullptr) {
+  if (GetVirtualMethodsPtrUnchecked() != nullptr) {
     for (auto& m : GetVirtualMethods(pointer_size)) {
       m.VisitRoots(visitor);
     }