diff options
author | 2024-05-09 07:45:02 +0000 | |
---|---|---|
committer | 2024-05-13 06:04:55 +0000 | |
commit | ffc0d1f69841fe4dcc8dca0676fb13466b9b8132 (patch) | |
tree | bc0846ea69dd927ac32be495a5fea03ef52af9dd /runtime/class_table.h | |
parent | 0bfa9a15cca4fbd2710ee3eead13bdd4dccaf86b (diff) |
Faster `ClassTable::UpdateClass()`.
In the `ClassTable::UpdateClass()`, both the old and the new
`Class` objects reference the same dex file and type index.
Therefore it's better to do the lookup with the new `Class`
object as the `Class:DescriptorEquals(ObjPtr<Class>)` can
avoid the string comparison for the descriptor match in this
case and we compare descriptors only for hash conflicts.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 338123769
Change-Id: I23960c9c3b34b7f7fdd2fce6b191fd9c4efe7320
Diffstat (limited to 'runtime/class_table.h')
-rw-r--r-- | runtime/class_table.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/class_table.h b/runtime/class_table.h index 1c9b0ce2e9..3374622f00 100644 --- a/runtime/class_table.h +++ b/runtime/class_table.h @@ -187,9 +187,7 @@ class ClassTable { REQUIRES_SHARED(Locks::mutator_lock_); // Update a class in the table with the new class. Returns the existing class which was replaced. - ObjPtr<mirror::Class> UpdateClass(const char* descriptor, - ObjPtr<mirror::Class> new_klass, - size_t hash) + ObjPtr<mirror::Class> UpdateClass(ObjPtr<mirror::Class> new_klass, size_t hash) REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); |