Revert "Hold dex caches live in class table"
This reverts commit d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e.
Bug: 29083330
(cherry picked from commit f102faf1bcbdb2149e3e7bf27b1819f621b7894b)
Change-Id: Id0c921bd6fe422159f8daa598dc8e7c9ed6eca47
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index a4b4889..7708b97 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1113,8 +1113,9 @@
uint16_t exception_type_idx = exception_type.first;
const DexFile* dex_file = exception_type.second;
StackHandleScope<2> hs2(self);
- Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile(*dex_file,
- nullptr)));
+ Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile(
+ *dex_file,
+ Runtime::Current()->GetLinearAlloc())));
Handle<mirror::Class> klass(hs2.NewHandle(
class_linker->ResolveType(*dex_file,
exception_type_idx,
@@ -2155,7 +2156,7 @@
hs.NewHandle(soa.Decode<mirror::ClassLoader*>(manager_->GetClassLoader())));
Handle<mirror::DexCache> dex_cache(hs.NewHandle(class_linker->RegisterDexFile(
dex_file,
- class_loader.Get())));
+ class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get()))));
mirror::Class* klass = class_linker->ResolveType(dex_file, type_idx, dex_cache, class_loader);
if (klass == nullptr) {