diff options
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 |
commit | 0795f23920ee9aabf28e45c63cd592dcccf00216 (patch) | |
tree | ff3f880c5e84f3316532b47d0e9a7729ade848ac /runtime/native/java_lang_DexCache.cc | |
parent | d1224dce59eb0019507e41da5e10f12dda66bee4 (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 'runtime/native/java_lang_DexCache.cc')
-rw-r--r-- | runtime/native/java_lang_DexCache.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/native/java_lang_DexCache.cc b/runtime/native/java_lang_DexCache.cc index f0140a303b..5efafe79fd 100644 --- a/runtime/native/java_lang_DexCache.cc +++ b/runtime/native/java_lang_DexCache.cc @@ -21,14 +21,14 @@ #include "mirror/class-inl.h" #include "mirror/dex_cache-inl.h" #include "mirror/object-inl.h" -#include "scoped_fast_native_object_access.h" +#include "scoped_fast_native_object_access-inl.h" #include "well_known_classes.h" namespace art { static jobject DexCache_getDexNative(JNIEnv* env, jobject javaDexCache) { ScopedFastNativeObjectAccess soa(env); - mirror::DexCache* dex_cache = soa.Decode<mirror::DexCache*>(javaDexCache); + ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); // Should only be called while holding the lock on the dex cache. DCHECK_EQ(dex_cache->GetLockOwnerThreadId(), soa.Self()->GetThreadId()); const DexFile* dex_file = dex_cache->GetDexFile(); @@ -51,14 +51,14 @@ static jobject DexCache_getDexNative(JNIEnv* env, jobject javaDexCache) { static jobject DexCache_getResolvedType(JNIEnv* env, jobject javaDexCache, jint type_index) { ScopedFastNativeObjectAccess soa(env); - mirror::DexCache* dex_cache = soa.Decode<mirror::DexCache*>(javaDexCache); + ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); CHECK_LT(static_cast<size_t>(type_index), dex_cache->NumResolvedTypes()); return soa.AddLocalReference<jobject>(dex_cache->GetResolvedType(type_index)); } static jobject DexCache_getResolvedString(JNIEnv* env, jobject javaDexCache, jint string_index) { ScopedFastNativeObjectAccess soa(env); - mirror::DexCache* dex_cache = soa.Decode<mirror::DexCache*>(javaDexCache); + ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); CHECK_LT(static_cast<size_t>(string_index), dex_cache->GetDexFile()->NumStringIds()); return soa.AddLocalReference<jobject>(dex_cache->GetResolvedString(string_index)); } @@ -66,17 +66,17 @@ static jobject DexCache_getResolvedString(JNIEnv* env, jobject javaDexCache, jin static void DexCache_setResolvedType(JNIEnv* env, jobject javaDexCache, jint type_index, jobject type) { ScopedFastNativeObjectAccess soa(env); - mirror::DexCache* dex_cache = soa.Decode<mirror::DexCache*>(javaDexCache); + ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); CHECK_LT(static_cast<size_t>(type_index), dex_cache->NumResolvedTypes()); - dex_cache->SetResolvedType(type_index, soa.Decode<mirror::Class*>(type)); + dex_cache->SetResolvedType(type_index, soa.Decode<mirror::Class>(type).Decode()); } static void DexCache_setResolvedString(JNIEnv* env, jobject javaDexCache, jint string_index, jobject string) { ScopedFastNativeObjectAccess soa(env); - mirror::DexCache* dex_cache = soa.Decode<mirror::DexCache*>(javaDexCache); + ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); CHECK_LT(static_cast<size_t>(string_index), dex_cache->GetDexFile()->NumStringIds()); - dex_cache->SetResolvedString(string_index, soa.Decode<mirror::String*>(string)); + dex_cache->SetResolvedString(string_index, soa.Decode<mirror::String>(string).Decode()); } static JNINativeMethod gMethods[] = { |