Always visit object class from VisitReferences
We don't want to unload classes which have instances.
Slight increase in CMS GC time from ~6.5s to ~7.3s on
EvaluateAndApplyChanges.
Bug: 22720414
Change-Id: I467ff9c9d55163d2a90b999aef3bdd7b3f648bac
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index f20cc6e..055b3e5 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -872,8 +872,8 @@
h_new_class_obj->SetClassSize(new_length_);
// Visit all of the references to make sure there is no from space references in the native
// roots.
- h_new_class_obj->VisitReferences<true>(h_new_class_obj->GetClass(),
- ReadBarrierOnNativeRootsVisitor());
+ static_cast<mirror::Object*>(h_new_class_obj.Get())->VisitReferences(
+ ReadBarrierOnNativeRootsVisitor(), VoidFunctor());
}
private: