summaryrefslogtreecommitdiff
path: root/runtime/class_linker-inl.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-11-05 14:33:29 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-11-11 08:33:23 +0000
commit01df4b3a9bb31f21f451452f0ce47632dd8916ad (patch)
tree2414f41e33f7c1ec468ea7c6f141267a6387d537 /runtime/class_linker-inl.h
parent8a2ca0019489d3e1c5a79789af68fb05822af9cb (diff)
Avoid `strlen()` for `ClassLinker::FindClass()`...
... and related functions in most cases. Note that the `CompilerDriver` previously resolved the `ClassLoader` and `TransactionAbortError` using the provided class loaders. We're now using the `ClassLoader` from the class roots and resolving the `TransactionAbortError` in the BCP class loader. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Bug: 338123769 Change-Id: I38e480cdcdb8bf02c958e4d0773437f5766f6be0
Diffstat (limited to 'runtime/class_linker-inl.h')
-rw-r--r--runtime/class_linker-inl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h
index 6461f54f5f..7d84fc1c09 100644
--- a/runtime/class_linker-inl.h
+++ b/runtime/class_linker-inl.h
@@ -25,7 +25,7 @@
#include "base/mutex.h"
#include "class_linker.h"
#include "class_table-inl.h"
-#include "dex/dex_file.h"
+#include "dex/dex_file-inl.h"
#include "dex/dex_file_structs.h"
#include "gc_root-inl.h"
#include "handle_scope-inl.h"
@@ -54,7 +54,8 @@ inline ObjPtr<mirror::Class> ClassLinker::FindArrayClass(Thread* self,
descriptor += element_class->GetDescriptor(&temp);
StackHandleScope<1> hs(Thread::Current());
Handle<mirror::ClassLoader> class_loader(hs.NewHandle(element_class->GetClassLoader()));
- ObjPtr<mirror::Class> array_class = FindClass(self, descriptor.c_str(), class_loader);
+ ObjPtr<mirror::Class> array_class =
+ FindClass(self, descriptor.c_str(), descriptor.length(), class_loader);
if (array_class != nullptr) {
// Benign races in storing array class and incrementing index.
size_t victim_index = find_array_class_cache_next_victim_;