VisitClasses doesn't internally check that classes are resolved. This
caused GetClassesAndMethodsVisitor to occasionally see ArtMethods
that didn't have their declaring class filled in.
The fix is to check that the class is actually resolved.
(cherry picked from commit
4219814f1545db945c1bacf4d38221371993a72d)
Test: test-art-host
Bug:
62585606
Merged-In: I3ed647ae15900c96d2180eb5c799f45393794dda
Change-Id: Id09e9e27cf09a921fbce4c917b8b6ef2daeaabaa
startup_method_samples_(startup_method_samples) {}
virtual bool operator()(ObjPtr<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_) {
- if (Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass)) {
+ if (Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(klass) ||
+ !klass->IsResolved() ||
+ klass->IsErroneousResolved()) {
return true;
}
for (ArtMethod& method : klass->GetMethods(kRuntimePointerSize)) {