summaryrefslogtreecommitdiff
path: root/test/497-inlining-and-class-loader
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-09-27 18:43:30 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-09-29 17:31:09 -0700
commit0795f23920ee9aabf28e45c63cd592dcccf00216 (patch)
treeff3f880c5e84f3316532b47d0e9a7729ade848ac /test/497-inlining-and-class-loader
parentd1224dce59eb0019507e41da5e10f12dda66bee4 (diff)
Clean up ScopedThreadStateChange to use ObjPtr
Also fixed inclusion of -inl.h files in .h files by adding scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h Changed AddLocalReference / Decode to use ObjPtr. Changed libartbenchmark to be debug to avoid linkage errors. Bug: 31113334 Test: test-art-host Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
Diffstat (limited to 'test/497-inlining-and-class-loader')
-rw-r--r--test/497-inlining-and-class-loader/clear_dex_cache.cc12
1 files changed, 6 insertions, 6 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 1597c4a65d..3f2df29472 100644
--- a/test/497-inlining-and-class-loader/clear_dex_cache.cc
+++ b/test/497-inlining-and-class-loader/clear_dex_cache.cc
@@ -17,7 +17,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
#include "jni.h"
-#include "scoped_thread_state_change.h"
+#include "scoped_thread_state_change-inl.h"
#include "stack.h"
#include "thread.h"
@@ -29,7 +29,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env,
jclass,
jclass cls) {
ScopedObjectAccess soa(Thread::Current());
- mirror::DexCache* dex_cache = soa.Decode<mirror::Class*>(cls)->GetDexCache();
+ mirror::DexCache* dex_cache = soa.Decode<mirror::Class>(cls)->GetDexCache();
size_t num_methods = dex_cache->NumResolvedMethods();
ArtMethod** methods = dex_cache->GetResolvedMethods();
CHECK_EQ(num_methods != 0u, methods != nullptr);
@@ -43,7 +43,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env,
array = env->NewLongArray(num_methods);
}
CHECK(array != nullptr);
- mirror::PointerArray* pointer_array = soa.Decode<mirror::PointerArray*>(array);
+ mirror::PointerArray* pointer_array = soa.Decode<mirror::PointerArray>(array).Decode();
for (size_t i = 0; i != num_methods; ++i) {
ArtMethod* method = mirror::DexCache::GetElementPtrSize(methods, i, kRuntimePointerSize);
pointer_array->SetElementPtrSize(i, method, kRuntimePointerSize);
@@ -54,11 +54,11 @@ extern "C" JNIEXPORT jobject JNICALL Java_Main_cloneResolvedMethods(JNIEnv* env,
extern "C" JNIEXPORT void JNICALL Java_Main_restoreResolvedMethods(
JNIEnv*, jclass, jclass cls, jobject old_cache) {
ScopedObjectAccess soa(Thread::Current());
- mirror::DexCache* dex_cache = soa.Decode<mirror::Class*>(cls)->GetDexCache();
+ mirror::DexCache* dex_cache = soa.Decode<mirror::Class>(cls)->GetDexCache();
size_t num_methods = dex_cache->NumResolvedMethods();
- ArtMethod** methods = soa.Decode<mirror::Class*>(cls)->GetDexCache()->GetResolvedMethods();
+ ArtMethod** methods = soa.Decode<mirror::Class>(cls)->GetDexCache()->GetResolvedMethods();
CHECK_EQ(num_methods != 0u, methods != nullptr);
- mirror::PointerArray* old = soa.Decode<mirror::PointerArray*>(old_cache);
+ ObjPtr<mirror::PointerArray> old = soa.Decode<mirror::PointerArray>(old_cache);
CHECK_EQ(methods != nullptr, old != nullptr);
CHECK_EQ(num_methods, static_cast<size_t>(old->GetLength()));
for (size_t i = 0; i != num_methods; ++i) {