From 01df4b3a9bb31f21f451452f0ce47632dd8916ad Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 5 Nov 2024 14:33:29 +0000 Subject: 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 --- runtime/native/java_lang_Class.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/native/java_lang_Class.cc') diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 79c8176027..c31c9790bd 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -111,8 +111,8 @@ static jclass Class_classForName(JNIEnv* env, jclass, jstring javaName, jboolean Handle class_loader( hs.NewHandle(soa.Decode(javaLoader))); ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); - Handle c( - hs.NewHandle(class_linker->FindClass(soa.Self(), descriptor.c_str(), class_loader))); + Handle c = hs.NewHandle( + class_linker->FindClass(soa.Self(), descriptor.c_str(), descriptor.length(), class_loader)); if (UNLIKELY(c == nullptr)) { StackHandleScope<2> hs2(soa.Self()); Handle cause = hs2.NewHandle(soa.Self()->GetException()); -- cgit v1.2.3-59-g8ed1b