summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2022-10-10 12:07:46 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2022-10-13 11:36:34 +0000
commit5111cb6b246c62a40806940076f9e10761f5f41c (patch)
treeef27b3465eef3c219e75d13276cecaf9441d6c4e /dex2oat/driver/compiler_driver_test.cc
parentd828fc10982300728d02c97dfac1a0e3684551c8 (diff)
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
Diffstat (limited to 'dex2oat/driver/compiler_driver_test.cc')
-rw-r--r--dex2oat/driver/compiler_driver_test.cc6
1 files changed, 0 insertions, 6 deletions
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<mirror::DexCache> 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<mirror::String> 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<mirror::Class> 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);