Merge "Verify the checksum before DCHECKS in ProfileCompilationInfo::GetOrAddDexFileData"
diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc
index 4b0e107..1f2163f 100644
--- a/runtime/jit/profile_compilation_info.cc
+++ b/runtime/jit/profile_compilation_info.cc
@@ -580,11 +580,6 @@
info_.push_back(dex_file_data);
}
DexFileData* result = info_[profile_index];
- // DCHECK that profile info map key is consistent with the one stored in the dex file data.
- // This should always be the case since since the cache map is managed by ProfileCompilationInfo.
- DCHECK_EQ(profile_key, result->profile_key);
- DCHECK_EQ(profile_index, result->profile_index);
- DCHECK_EQ(num_method_ids, result->num_method_ids);
// Check that the checksum matches.
// This may different if for example the dex file was updated and we had a record of the old one.
@@ -592,6 +587,13 @@
LOG(WARNING) << "Checksum mismatch for dex " << profile_key;
return nullptr;
}
+
+ // DCHECK that profile info map key is consistent with the one stored in the dex file data.
+ // This should always be the case since since the cache map is managed by ProfileCompilationInfo.
+ DCHECK_EQ(profile_key, result->profile_key);
+ DCHECK_EQ(profile_index, result->profile_index);
+ DCHECK_EQ(num_method_ids, result->num_method_ids);
+
return result;
}
@@ -1186,6 +1188,7 @@
}
return true;
}
+
std::unique_ptr<uint8_t[]> ProfileCompilationInfo::DeflateBuffer(const uint8_t* in_buffer,
uint32_t in_size,
uint32_t* compressed_data_size) {