diff options
| author | 2021-06-14 10:59:51 +0100 | |
|---|---|---|
| committer | 2021-12-20 12:11:45 +0000 | |
| commit | 5d0afa18434aa8281254d09367c6c6f7808b8344 (patch) | |
| tree | 33107be70caf889e9ad91d1267612993dc1e974e /disassembler/disassembler.h | |
| parent | ba1b94e8ebf35947e1ce127d67ab164a76ec251c (diff) | |
Rewrite static/instance field search by index.
The old search was looking for a field with the given field
index in the class as well as superclasses and, for static
fields, all interfaces. This was useless as as a field index
can match only in the declaring class. So, if the field was
not found in the declaring class we would have unnecessarily
searched wrong classes before resorting to string search.
Reuse the optimized `Class::FindField` by turning it into
a template implementation that can skip unnecessary static
or instance field searches. Implementing the static and
instance field search this way allows ClassLinker to call
only one overload of `Class::Find{Static,Instance}Field`
and helps avoid string searches in more cases.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --interpreter
Bug: 181943478
(cherry picked from commit 40261171630159bfd46043c996be8521c453fee1)
Merged-In: I23309c87c3702d98812adfec0279c483c9037f2c
Change-Id: I0d7b20ea0ea677d34e1794be3c54dcbffdd5811c
Diffstat (limited to 'disassembler/disassembler.h')
0 files changed, 0 insertions, 0 deletions