diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/497-inlining-and-class-loader/clear_dex_cache.cc | 10 | ||||
-rw-r--r-- | test/626-const-class-linking/clear_dex_cache_types.cc | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/test/497-inlining-and-class-loader/clear_dex_cache.cc b/test/497-inlining-and-class-loader/clear_dex_cache.cc index 36ec4eb65c..ddbcef59c8 100644 --- a/test/497-inlining-and-class-loader/clear_dex_cache.cc +++ b/test/497-inlining-and-class-loader/clear_dex_cache.cc @@ -34,7 +34,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env, ScopedObjectAccess soa(Thread::Current()); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::Class>(cls)->GetDexCache(); size_t num_methods = dex_cache->NumResolvedMethods(); - mirror::MethodDexCacheType* methods = dex_cache->GetResolvedMethods(); + auto* methods = dex_cache->GetResolvedMethods(); CHECK_EQ(num_methods != 0u, methods != nullptr); if (num_methods == 0u) { return nullptr; @@ -48,7 +48,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env, CHECK(array != nullptr); ObjPtr<mirror::Array> decoded_array = soa.Decode<mirror::Array>(array); for (size_t i = 0; i != num_methods; ++i) { - auto pair = mirror::DexCache::GetNativePair(methods, i); + auto pair = methods->GetNativePair(i); uint32_t index = pair.index; ArtMethod* method = pair.object; if (sizeof(void*) == 4) { @@ -69,7 +69,7 @@ extern "C" JNIEXPORT void JNICALL Java_Main_restoreResolvedMethods( ScopedObjectAccess soa(Thread::Current()); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::Class>(cls)->GetDexCache(); size_t num_methods = dex_cache->NumResolvedMethods(); - mirror::MethodDexCacheType* methods = dex_cache->GetResolvedMethods(); + auto* methods = dex_cache->GetResolvedMethods(); CHECK_EQ(num_methods != 0u, methods != nullptr); ObjPtr<mirror::Array> old = soa.Decode<mirror::Array>(old_cache); CHECK_EQ(methods != nullptr, old != nullptr); @@ -86,8 +86,8 @@ extern "C" JNIEXPORT void JNICALL Java_Main_restoreResolvedMethods( index = dchecked_integral_cast<uint32_t>(long_array->Get(2u * i)); method = reinterpret_cast64<ArtMethod*>(long_array->Get(2u * i + 1u)); } - mirror::MethodDexCachePair pair(method, index); - mirror::DexCache::SetNativePair(methods, i, pair); + mirror::NativeDexCachePair<ArtMethod> pair(method, index); + methods->SetNativePair(i, pair); } } diff --git a/test/626-const-class-linking/clear_dex_cache_types.cc b/test/626-const-class-linking/clear_dex_cache_types.cc index 1aa3cce40f..ef230ad38a 100644 --- a/test/626-const-class-linking/clear_dex_cache_types.cc +++ b/test/626-const-class-linking/clear_dex_cache_types.cc @@ -28,8 +28,7 @@ extern "C" JNIEXPORT void JNICALL Java_Main_nativeClearResolvedTypes(JNIEnv*, jc ScopedObjectAccess soa(Thread::Current()); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::Class>(cls)->GetDexCache(); for (size_t i = 0, num_types = dex_cache->NumResolvedTypes(); i != num_types; ++i) { - mirror::TypeDexCachePair cleared(nullptr, mirror::TypeDexCachePair::InvalidIndexForSlot(i)); - dex_cache->GetResolvedTypes()[i].store(cleared, std::memory_order_relaxed); + dex_cache->GetResolvedTypes()->Clear(i); } } |