From 5111cb6b246c62a40806940076f9e10761f5f41c Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 10 Oct 2022 12:07:46 +0100 Subject: Refactor and cleanup DexCache. - Introduce macros to avoid duplicating code for each dex cache kind. - Remove preResolvedStrings, this was unused. - Remove dex cache length fields, we can easily infer them. Test: test.py Change-Id: I1e0bc8cf078ce8e09c4d756c63be32cb344fcce1 --- dex2oat/driver/compiler_driver_test.cc | 6 ------ 1 file changed, 6 deletions(-) (limited to 'dex2oat/driver/compiler_driver_test.cc') diff --git a/dex2oat/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc index 7e3f40ce05..759426a1d3 100644 --- a/dex2oat/driver/compiler_driver_test.cc +++ b/dex2oat/driver/compiler_driver_test.cc @@ -130,19 +130,15 @@ TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) { ASSERT_TRUE(java_lang_dex_file_ != nullptr); const DexFile& dex = *java_lang_dex_file_; ObjPtr dex_cache = class_linker_->FindDexCache(soa.Self(), dex); - EXPECT_EQ(dex.NumStringIds(), dex_cache->NumStrings()); for (size_t i = 0; i < dex_cache->NumStrings(); i++) { const ObjPtr string = dex_cache->GetResolvedString(dex::StringIndex(i)); EXPECT_TRUE(string != nullptr) << "string_idx=" << i; } - EXPECT_EQ(dex.NumTypeIds(), dex_cache->NumResolvedTypes()); for (size_t i = 0; i < dex_cache->NumResolvedTypes(); i++) { const ObjPtr type = dex_cache->GetResolvedType(dex::TypeIndex(i)); EXPECT_TRUE(type != nullptr) << "type_idx=" << i << " " << dex.GetTypeDescriptor(dex.GetTypeId(dex::TypeIndex(i))); } - EXPECT_TRUE(dex_cache->StaticMethodSize() == dex_cache->NumResolvedMethods() - || dex.NumMethodIds() == dex_cache->NumResolvedMethods()); for (size_t i = 0; i < dex_cache->NumResolvedMethods(); i++) { // FIXME: This is outdated for hash-based method array. ArtMethod* method = dex_cache->GetResolvedMethod(i); @@ -153,8 +149,6 @@ TEST_F(CompilerDriverTest, DISABLED_LARGE_CompileDexLibCore) { << " " << dex.GetMethodDeclaringClassDescriptor(dex.GetMethodId(i)) << " " << dex.GetMethodName(dex.GetMethodId(i)); } - EXPECT_TRUE(dex_cache->StaticArtFieldSize() == dex_cache->NumResolvedFields() - || dex.NumFieldIds() == dex_cache->NumResolvedFields()); for (size_t i = 0; i < dex_cache->NumResolvedFields(); i++) { // FIXME: This is outdated for hash-based field array. ArtField* field = dex_cache->GetResolvedField(i); -- cgit v1.2.3-59-g8ed1b