summaryrefslogtreecommitdiff
path: root/runtime/gc/reference_queue_test.cc
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/gc/reference_queue_test.cc
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/gc/reference_queue_test.cc')
-rw-r--r--runtime/gc/reference_queue_test.cc9
1 files changed, 3 insertions, 6 deletions
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<mirror::ClassLoader>()));
+ FindClass("Ljava/lang/ref/WeakReference;", ScopedNullHandle<mirror::ClassLoader>()));
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<mirror::ClassLoader>()));
+ FindClass("Ljava/lang/ref/WeakReference;", ScopedNullHandle<mirror::ClassLoader>()));
ASSERT_TRUE(weak_ref_class != nullptr);
auto finalizer_ref_class = hs.NewHandle(
- Runtime::Current()->GetClassLinker()->FindClass(self, "Ljava/lang/ref/FinalizerReference;",
- ScopedNullHandle<mirror::ClassLoader>()));
+ FindClass("Ljava/lang/ref/FinalizerReference;", ScopedNullHandle<mirror::ClassLoader>()));
ASSERT_TRUE(finalizer_ref_class != nullptr);
auto ref1(hs.NewHandle(weak_ref_class->AllocObject(self)->AsReference()));
ASSERT_TRUE(ref1 != nullptr);