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/gc/reference_queue_test.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'runtime/gc/reference_queue_test.cc') diff --git a/runtime/gc/reference_queue_test.cc b/runtime/gc/reference_queue_test.cc index 2b5c3fdea7..ce4f8d93b0 100644 --- a/runtime/gc/reference_queue_test.cc +++ b/runtime/gc/reference_queue_test.cc @@ -42,8 +42,7 @@ TEST_F(ReferenceQueueTest, EnqueueDequeue) { ASSERT_TRUE(queue.IsEmpty()); ASSERT_EQ(queue.GetLength(), 0U); auto ref_class = hs.NewHandle( - Runtime::Current()->GetClassLinker()->FindClass(self, "Ljava/lang/ref/WeakReference;", - ScopedNullHandle())); + FindClass("Ljava/lang/ref/WeakReference;", ScopedNullHandle())); ASSERT_TRUE(ref_class != nullptr); auto ref1(hs.NewHandle(ref_class->AllocObject(self)->AsReference())); ASSERT_TRUE(ref1 != nullptr); @@ -77,12 +76,10 @@ TEST_F(ReferenceQueueTest, Dump) { queue.Dump(oss); LOG(INFO) << oss.str(); auto weak_ref_class = hs.NewHandle( - Runtime::Current()->GetClassLinker()->FindClass(self, "Ljava/lang/ref/WeakReference;", - ScopedNullHandle())); + FindClass("Ljava/lang/ref/WeakReference;", ScopedNullHandle())); ASSERT_TRUE(weak_ref_class != nullptr); auto finalizer_ref_class = hs.NewHandle( - Runtime::Current()->GetClassLinker()->FindClass(self, "Ljava/lang/ref/FinalizerReference;", - ScopedNullHandle())); + FindClass("Ljava/lang/ref/FinalizerReference;", ScopedNullHandle())); ASSERT_TRUE(finalizer_ref_class != nullptr); auto ref1(hs.NewHandle(weak_ref_class->AllocObject(self)->AsReference())); ASSERT_TRUE(ref1 != nullptr); -- cgit v1.2.3-59-g8ed1b