diff options
author | 2017-02-01 14:09:13 +0000 | |
---|---|---|
committer | 2017-02-01 15:27:37 +0000 | |
commit | d16363a93053de0f32252c7897d839a46aff14ae (patch) | |
tree | 8823c6dd4641eae333aa7001203460757a515010 /runtime/native/java_lang_DexCache.cc | |
parent | ac240396125911b52437a460a400c8b38be43a96 (diff) |
Revert "Hash-based dex cache type array."
Reverting to work around some programs crashing with
Check failed: handle_scope_iface.Get() != nullptr.
though the reason for the failure not yet understood.
Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969
Bug: 30419309
This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8.
Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
Diffstat (limited to 'runtime/native/java_lang_DexCache.cc')
-rw-r--r-- | runtime/native/java_lang_DexCache.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/runtime/native/java_lang_DexCache.cc b/runtime/native/java_lang_DexCache.cc index 0b667fec45..f1c350f23c 100644 --- a/runtime/native/java_lang_DexCache.cc +++ b/runtime/native/java_lang_DexCache.cc @@ -53,7 +53,7 @@ static jobject DexCache_getDexNative(JNIEnv* env, jobject javaDexCache) { static jobject DexCache_getResolvedType(JNIEnv* env, jobject javaDexCache, jint type_index) { ScopedFastNativeObjectAccess soa(env); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); - CHECK_LT(static_cast<size_t>(type_index), dex_cache->GetDexFile()->NumTypeIds()); + CHECK_LT(static_cast<size_t>(type_index), dex_cache->NumResolvedTypes()); return soa.AddLocalReference<jobject>(dex_cache->GetResolvedType(dex::TypeIndex(type_index))); } @@ -69,11 +69,8 @@ static void DexCache_setResolvedType(JNIEnv* env, jobject javaDexCache, jint typ jobject type) { ScopedFastNativeObjectAccess soa(env); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); - CHECK_LT(static_cast<size_t>(type_index), dex_cache->GetDexFile()->NumTypeIds()); - ObjPtr<mirror::Class> t = soa.Decode<mirror::Class>(type); - if (t != nullptr) { - dex_cache->SetResolvedType(dex::TypeIndex(type_index), t); - } + CHECK_LT(static_cast<size_t>(type_index), dex_cache->NumResolvedTypes()); + dex_cache->SetResolvedType(dex::TypeIndex(type_index), soa.Decode<mirror::Class>(type)); } static void DexCache_setResolvedString(JNIEnv* env, jobject javaDexCache, jint string_index, @@ -81,10 +78,7 @@ static void DexCache_setResolvedString(JNIEnv* env, jobject javaDexCache, jint s ScopedFastNativeObjectAccess soa(env); ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache); CHECK_LT(static_cast<size_t>(string_index), dex_cache->GetDexFile()->NumStringIds()); - ObjPtr<mirror::String> s = soa.Decode<mirror::String>(string); - if (s != nullptr) { - dex_cache->SetResolvedString(dex::StringIndex(string_index), s); - } + dex_cache->SetResolvedString(dex::StringIndex(string_index), soa.Decode<mirror::String>(string)); } static JNINativeMethod gMethods[] = { |