diff options
author | 2017-02-13 18:32:04 -0800 | |
---|---|---|
committer | 2017-02-13 19:34:54 -0800 | |
commit | 5812e20ff7cbc8efa0b8d7486ada2f58840a6ad5 (patch) | |
tree | be0e9fdeb90bcbad76b17b3aae4e746d977d80ee /runtime/mirror/dex_cache.cc | |
parent | 518f373324f355f8e58440dfbc3f5a1f2244bde7 (diff) |
Revert^3 "Hash-based dex cache type array."
Assert failing for "earchbox:search":
F zygote64: class_linker.cc:4612] Check failed: handle_scope_iface.Get() != nullptr
Test: m test-art-host
Bug: 34839984
Bug: 30627598
Bug: 34659969
This reverts commit 85c0f2ac03417f5125bc2ff1dab8109859c67d5c.
Change-Id: I39846c20295af5875b0f945be7035c73ded23135
Diffstat (limited to 'runtime/mirror/dex_cache.cc')
-rw-r--r-- | runtime/mirror/dex_cache.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc index 3103a92c83..741cf3bb47 100644 --- a/runtime/mirror/dex_cache.cc +++ b/runtime/mirror/dex_cache.cc @@ -58,8 +58,8 @@ void DexCache::InitializeDexCache(Thread* self, mirror::StringDexCacheType* strings = (dex_file->NumStringIds() == 0u) ? nullptr : reinterpret_cast<mirror::StringDexCacheType*>(raw_arrays + layout.StringsOffset()); - mirror::TypeDexCacheType* types = (dex_file->NumTypeIds() == 0u) ? nullptr : - reinterpret_cast<mirror::TypeDexCacheType*>(raw_arrays + layout.TypesOffset()); + GcRoot<mirror::Class>* types = (dex_file->NumTypeIds() == 0u) ? nullptr : + reinterpret_cast<GcRoot<mirror::Class>*>(raw_arrays + layout.TypesOffset()); ArtMethod** methods = (dex_file->NumMethodIds() == 0u) ? nullptr : reinterpret_cast<ArtMethod**>(raw_arrays + layout.MethodsOffset()); ArtField** fields = (dex_file->NumFieldIds() == 0u) ? nullptr : @@ -69,10 +69,6 @@ void DexCache::InitializeDexCache(Thread* self, if (dex_file->NumStringIds() < num_strings) { num_strings = dex_file->NumStringIds(); } - size_t num_types = mirror::DexCache::kDexCacheTypeCacheSize; - if (dex_file->NumTypeIds() < num_types) { - num_types = dex_file->NumTypeIds(); - } // Note that we allocate the method type dex caches regardless of this flag, // and we make sure here that they're not used by the runtime. This is in the @@ -108,9 +104,8 @@ void DexCache::InitializeDexCache(Thread* self, CHECK_EQ(strings[i].load(std::memory_order_relaxed).index, 0u); CHECK(strings[i].load(std::memory_order_relaxed).object.IsNull()); } - for (size_t i = 0; i < num_types; ++i) { - CHECK_EQ(types[i].load(std::memory_order_relaxed).index, 0u); - CHECK(types[i].load(std::memory_order_relaxed).object.IsNull()); + for (size_t i = 0; i < dex_file->NumTypeIds(); ++i) { + CHECK(types[i].IsNull()); } for (size_t i = 0; i < dex_file->NumMethodIds(); ++i) { CHECK(mirror::DexCache::GetElementPtrSize(methods, i, image_pointer_size) == nullptr); @@ -126,9 +121,6 @@ void DexCache::InitializeDexCache(Thread* self, if (strings != nullptr) { mirror::StringDexCachePair::Initialize(strings); } - if (types != nullptr) { - mirror::TypeDexCachePair::Initialize(types); - } if (method_types != nullptr) { mirror::MethodTypeDexCachePair::Initialize(method_types); } @@ -137,7 +129,7 @@ void DexCache::InitializeDexCache(Thread* self, strings, num_strings, types, - num_types, + dex_file->NumTypeIds(), methods, dex_file->NumMethodIds(), fields, @@ -151,7 +143,7 @@ void DexCache::Init(const DexFile* dex_file, ObjPtr<String> location, StringDexCacheType* strings, uint32_t num_strings, - TypeDexCacheType* resolved_types, + GcRoot<Class>* resolved_types, uint32_t num_resolved_types, ArtMethod** resolved_methods, uint32_t num_resolved_methods, |