diff options
| author | 2021-06-10 09:52:53 +0100 | |
|---|---|---|
| committer | 2021-12-20 12:07:43 +0000 | |
| commit | ba1b94e8ebf35947e1ce127d67ab164a76ec251c (patch) | |
| tree | 58f5d61d767315ef8dd2734f9be1c48532e8ce55 /runtime/mirror/class.h | |
| parent | c8d57bec6249f3222e5f05f8f7e46baf06865ffe (diff) | |
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
Diffstat (limited to 'runtime/mirror/class.h')
| -rw-r--r-- | runtime/mirror/class.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index aff98cabe2..35ef358158 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -1092,10 +1092,7 @@ class MANAGED Class final : public Object { ArtField* GetStaticField(uint32_t i) REQUIRES_SHARED(Locks::mutator_lock_); // Find a static or instance field using the JLS resolution order - static ArtField* FindField(Thread* self, - ObjPtr<Class> klass, - ObjPtr<mirror::DexCache> dex_cache, - uint32_t field_idx) + ArtField* FindField(ObjPtr<mirror::DexCache> dex_cache, uint32_t field_idx) REQUIRES_SHARED(Locks::mutator_lock_); // Finds the given instance field in this class or a superclass. @@ -1114,18 +1111,12 @@ class MANAGED Class final : public Object { REQUIRES_SHARED(Locks::mutator_lock_); // Finds the given static field in this class or a superclass. - static ArtField* FindStaticField(Thread* self, - ObjPtr<Class> klass, - std::string_view name, - std::string_view type) + ArtField* FindStaticField(std::string_view name, std::string_view type) REQUIRES_SHARED(Locks::mutator_lock_); // Finds the given static field in this class or superclass, only searches classes that // have the same dex cache. - static ArtField* FindStaticField(Thread* self, - ObjPtr<Class> klass, - ObjPtr<DexCache> dex_cache, - uint32_t dex_field_idx) + ArtField* FindStaticField(ObjPtr<DexCache> dex_cache, uint32_t dex_field_idx) REQUIRES_SHARED(Locks::mutator_lock_); ArtField* FindDeclaredStaticField(std::string_view name, std::string_view type) @@ -1219,11 +1210,10 @@ class MANAGED Class final : public Object { dex::TypeIndex GetDirectInterfaceTypeIdx(uint32_t idx) REQUIRES_SHARED(Locks::mutator_lock_); - // Get the direct interface of the `klass` at index `idx` if resolved, otherwise return null. + // Get the direct interface at index `idx` if resolved, otherwise return null. // If the caller expects the interface to be resolved, for example for a resolved `klass`, // that assumption should be checked by `DCHECK(result != nullptr)`. - static ObjPtr<Class> GetDirectInterface(Thread* self, ObjPtr<Class> klass, uint32_t idx) - REQUIRES_SHARED(Locks::mutator_lock_); + ObjPtr<Class> GetDirectInterface(uint32_t idx) REQUIRES_SHARED(Locks::mutator_lock_); // Resolve and get the direct interface of the `klass` at index `idx`. // Returns null with a pending exception if the resolution fails. |