Clean up Class::GetDirectInterface().
Fetch array interfaces from the `IfTable`. This removes the
only use of the `Thread* self` argument, so we can remove
that argument. We also make the function non-static to avoid
the explicit `klass` argument. Similarly clean up arguments
of `Class::FindClass()` and `Class::FindStaticClass()`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: Id639b675b4eb331a777cf318eb61bd19e05de4f0
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index f4e34dd..27fed28 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -415,8 +415,7 @@
Visit(self, klass->GetSuperClass(), visitor);
}
for (uint32_t i = 0; i != klass->NumDirectInterfaces(); ++i) {
- art::ObjPtr<art::mirror::Class> inf_klass =
- art::mirror::Class::GetDirectInterface(self, klass, i);
+ art::ObjPtr<art::mirror::Class> inf_klass = klass->GetDirectInterface(i);
DCHECK(inf_klass != nullptr);
VisitInterface(self, inf_klass, visitor);
}
@@ -436,8 +435,7 @@
// Now visit the superinterfaces.
for (uint32_t i = 0; i != inf_klass->NumDirectInterfaces(); ++i) {
- art::ObjPtr<art::mirror::Class> super_inf_klass =
- art::mirror::Class::GetDirectInterface(self, inf_klass, i);
+ art::ObjPtr<art::mirror::Class> super_inf_klass = inf_klass->GetDirectInterface(i);
DCHECK(super_inf_klass != nullptr);
VisitInterface(self, super_inf_klass, visitor);
}