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/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc
index dd9e2d1..5151819 100644
--- a/runtime/gc/accounting/mod_union_table.cc
+++ b/runtime/gc/accounting/mod_union_table.cc
@@ -153,7 +153,7 @@
DCHECK(root != nullptr);
ModUnionUpdateObjectReferencesVisitor ref_visitor(visitor_, from_space_, immune_space_,
contains_reference_to_other_space_);
- root->VisitReferences<kMovingClasses>(ref_visitor, VoidFunctor());
+ root->VisitReferences(ref_visitor, VoidFunctor());
}
private:
@@ -237,7 +237,7 @@
visitor_,
references_,
has_target_reference_);
- obj->VisitReferences<kMovingClasses>(visitor, VoidFunctor());
+ obj->VisitReferences(visitor, VoidFunctor());
}
private:
@@ -304,7 +304,7 @@
void operator()(Object* obj) const NO_THREAD_SAFETY_ANALYSIS {
Locks::heap_bitmap_lock_->AssertSharedHeld(Thread::Current());
CheckReferenceVisitor visitor(mod_union_table_, references_);
- obj->VisitReferences<kMovingClasses>(visitor, VoidFunctor());
+ obj->VisitReferences(visitor, VoidFunctor());
}
private: