diff options
author | 2022-11-29 10:30:42 +0000 | |
---|---|---|
committer | 2022-11-30 15:38:00 +0000 | |
commit | 97de32773e20297125d4e35e5d7dcb3b6732e063 (patch) | |
tree | 0d1f79ef1a8b7f82f0b3d70311d0b2ed85707244 /runtime/reference_table_test.cc | |
parent | 0110e952e488bc41429f6f33f36e8884f41a26d8 (diff) |
Change well known method `String.charAt()` to `ArtMethod*`.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Idb34c5de408b98db746d385ae6e012a8997fcc96
Diffstat (limited to 'runtime/reference_table_test.cc')
-rw-r--r-- | runtime/reference_table_test.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/runtime/reference_table_test.cc b/runtime/reference_table_test.cc index 5fc01abadb..420543eb93 100644 --- a/runtime/reference_table_test.cc +++ b/runtime/reference_table_test.cc @@ -22,6 +22,7 @@ #include "art_method-inl.h" #include "class_linker.h" +#include "class_root-inl.h" #include "common_runtime_test.h" #include "dex/primitive.h" #include "handle_scope-inl.h" @@ -34,7 +35,6 @@ #include "runtime.h" #include "scoped_thread_state_change-inl.h" #include "thread-current-inl.h" -#include "well_known_classes.h" namespace art { @@ -199,18 +199,12 @@ TEST_F(ReferenceTableTest, Basics) { // avoids having to create the low-level args array ourselves. Handle<mirror::Object> h_with_trace; { - jmethodID substr = soa.Env()->GetMethodID(WellKnownClasses::java_lang_String, - "substring", - "(II)Ljava/lang/String;"); + ArtMethod* substr = GetClassRoot<mirror::String>()->FindClassMethod( + "substring", "(II)Ljava/lang/String;", kRuntimePointerSize); ASSERT_TRUE(substr != nullptr); - jobject jobj = soa.Env()->AddLocalReference<jobject>(h_without_trace.Get()); - ASSERT_TRUE(jobj != nullptr); - jobject result = soa.Env()->CallObjectMethod(jobj, - substr, - static_cast<jint>(0), - static_cast<jint>(4)); - ASSERT_TRUE(result != nullptr); - h_with_trace = hs.NewHandle(soa.Self()->DecodeJObject(result)); + h_with_trace = hs.NewHandle( + substr->InvokeFinal<'L', 'I', 'I'>(soa.Self(), h_without_trace.Get(), 0, 4)); + ASSERT_TRUE(h_with_trace != nullptr); } Handle<mirror::Object> h_ref; |