summaryrefslogtreecommitdiff
path: root/libnativeloader/native_loader_test.cpp
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2021-06-14 10:59:51 +0100
committer Vladimir Marko <vmarko@google.com> 2021-06-14 17:55:51 +0000
commit40261171630159bfd46043c996be8521c453fee1 (patch)
tree3cae9dfcfd5f745b61da630d031eff4f67fe9185 /libnativeloader/native_loader_test.cpp
parentaf5d304844cd8e39fcc31ca4e07e3e887d2f0bd9 (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 Change-Id: I23309c87c3702d98812adfec0279c483c9037f2c
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
0 files changed, 0 insertions, 0 deletions