From ba1b94e8ebf35947e1ce127d67ab164a76ec251c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 10 Jun 2021 09:52:53 +0100 Subject: 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 (cherry picked from commit b10668cb6a34398eb720f9a6305ff9a51b3ebfd4) Merged-In: Id639b675b4eb331a777cf318eb61bd19e05de4f0 Change-Id: I34d11499aea5a95864bf1cdcb4f210547a07f33c --- dex2oat/driver/compiler_driver.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dex2oat/driver/compiler_driver.cc') diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc index 9029693999..26f606e25c 100644 --- a/dex2oat/driver/compiler_driver.cc +++ b/dex2oat/driver/compiler_driver.cc @@ -1124,7 +1124,7 @@ static void MaybeAddToImageClasses(Thread* self, image_classes->insert(descriptor); VLOG(compiler) << "Adding " << descriptor << " to image classes"; for (size_t i = 0, num_interfaces = klass->NumDirectInterfaces(); i != num_interfaces; ++i) { - ObjPtr interface = mirror::Class::GetDirectInterface(self, klass, i); + ObjPtr interface = klass->GetDirectInterface(i); DCHECK(interface != nullptr); MaybeAddToImageClasses(self, interface, image_classes); } @@ -2468,7 +2468,7 @@ class InitializeClassVisitor : public CompilationVisitor { } // In this phase the classes containing class initializers are ignored. Make sure no - // clinit appears in kalss's super class chain and interfaces. + // clinit appears in klass's super class chain and interfaces. bool NoClinitInDependency(const Handle& klass, Thread* self, Handle* class_loader) @@ -2490,8 +2490,8 @@ class InitializeClassVisitor : public CompilationVisitor { uint32_t num_if = klass->NumDirectInterfaces(); for (size_t i = 0; i < num_if; i++) { - ObjPtr - interface = mirror::Class::GetDirectInterface(self, klass.Get(), i); + ObjPtr interface = klass->GetDirectInterface(i); + DCHECK(interface != nullptr); StackHandleScope<1> hs(self); Handle handle_interface(hs.NewHandle(interface)); if (!NoClinitInDependency(handle_interface, self, class_loader)) { -- cgit v1.2.3-59-g8ed1b