Encode quickening info in .vdex.
We quicken vdex files for performance reasons, but when taking an OTA,
we need to revert the quickening to the original instructions. As vdex
should be independent of the oat file and oat file versions, we encode
the quickening data in the vdex.
test: m test-art-host-jit m test-art-host-gtest
bug:30937355
Change-Id: I9a543a161b70aa1cff99f8fe6f5b5cab7a6c4d31
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index 3065f68..c550a1b 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -468,7 +468,18 @@
if (!found || (oat_method.GetQuickCode() != nullptr)) {
return nullptr;
}
- return oat_method.GetVmapTable();
+ if (kIsVdexEnabled) {
+ const OatQuickMethodHeader* header = oat_method.GetOatQuickMethodHeader();
+ // OatMethod without a header: no quickening table.
+ if (header == nullptr) {
+ return nullptr;
+ }
+ // The table is in the .vdex file.
+ const OatFile::OatDexFile* oat_dex_file = GetDexCache()->GetDexFile()->GetOatDexFile();
+ return oat_dex_file->GetOatFile()->DexBegin() + header->vmap_table_offset_;
+ } else {
+ return oat_method.GetVmapTable();
+ }
}
const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) {