diff options
author | 2024-05-06 07:43:35 +0000 | |
---|---|---|
committer | 2024-05-09 09:24:11 +0000 | |
commit | 1ca987e8b5cc2b9b3a15fc8187b987678c54b899 (patch) | |
tree | 27d9c4d9406713d2287e2e9abfbb068198a02d50 /runtime/mirror/class.h | |
parent | 8e4b50a62ddb7ecfecb3e0caf3cab9f0e35eee76 (diff) |
Avoid some `std::string` construction in `ClassTable`.
Do not construct a `std::string` when compaing most class
descriptors for `Class` objects. We still construct it for
the edge case when comparing a proxy class and non-proxy
class descriptors which should really yield false, except
that ART does not propely enforce the namespace separation.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 338123769
Change-Id: I001abf9dd6648621e86f43a8234d2c0c1d02471c
Diffstat (limited to 'runtime/mirror/class.h')
-rw-r--r-- | runtime/mirror/class.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 42ce9d1349..2a95d2227d 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -1231,6 +1231,7 @@ class EXPORT MANAGED Class final : public Object { // this to avoid memory allocation in the common case. const char* GetDescriptor(std::string* storage) REQUIRES_SHARED(Locks::mutator_lock_); + bool DescriptorEquals(ObjPtr<mirror::Class> match) REQUIRES_SHARED(Locks::mutator_lock_); bool DescriptorEquals(const char* match) REQUIRES_SHARED(Locks::mutator_lock_); uint32_t DescriptorHash() REQUIRES_SHARED(Locks::mutator_lock_); @@ -1418,6 +1419,7 @@ class EXPORT MANAGED Class final : public Object { // The index in the methods_ array where the first direct method is. ALWAYS_INLINE uint32_t GetDirectMethodsStartOffset() REQUIRES_SHARED(Locks::mutator_lock_); + bool ProxyDescriptorEquals(ObjPtr<mirror::Class> match) REQUIRES_SHARED(Locks::mutator_lock_); bool ProxyDescriptorEquals(const char* match) REQUIRES_SHARED(Locks::mutator_lock_); static uint32_t UpdateHashForProxyClass(uint32_t hash, ObjPtr<mirror::Class> proxy_class) REQUIRES_SHARED(Locks::mutator_lock_); |