summaryrefslogtreecommitdiff
path: root/patchoat/patchoat.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-07-06 14:55:02 +0100
committer Vladimir Marko <vmarko@google.com> 2017-07-20 16:33:00 +0100
commit07bfbace6f835e6c748fd68ec7624992478b16c1 (patch)
tree5d094a00fbc90455bd9b53e042cf8b4fe8433462 /patchoat/patchoat.cc
parentba118827465d12177f3996e50133960087b1c916 (diff)
Hash-based DexCache methods array.
Total boot*.art size for aosp_angler-userdebug: - arm64: - before: 11603968 - after: 10129408 (-1.4MiB, -12.7%) - arm: - before: 8626176 - after: 7888896 (-0.7MiB, -8.5%) Test: m test-art-host-gtest Test: testrunner.py --host Test: Nexus 6P boots. Test: testrunner.py --target Test: Build aosp_mips64-eng Bug: 30627598 Change-Id: I7f858605de5f074cbd7f0d9c4c072fbd44aee28f
Diffstat (limited to 'patchoat/patchoat.cc')
-rw-r--r--patchoat/patchoat.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index a93969f0c0..1ee2fbd3c0 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -535,17 +535,18 @@ void PatchOat::PatchDexFileArrays(mirror::ObjectArray<mirror::Object>* img_roots
orig_dex_cache->FixupResolvedTypes(RelocatedCopyOf(orig_types),
RelocatedPointerVisitor(this));
}
- ArtMethod** orig_methods = orig_dex_cache->GetResolvedMethods();
- ArtMethod** relocated_methods = RelocatedAddressOfPointer(orig_methods);
+ mirror::MethodDexCacheType* orig_methods = orig_dex_cache->GetResolvedMethods();
+ mirror::MethodDexCacheType* relocated_methods = RelocatedAddressOfPointer(orig_methods);
copy_dex_cache->SetField64<false>(
mirror::DexCache::ResolvedMethodsOffset(),
static_cast<int64_t>(reinterpret_cast<uintptr_t>(relocated_methods)));
if (orig_methods != nullptr) {
- ArtMethod** copy_methods = RelocatedCopyOf(orig_methods);
+ mirror::MethodDexCacheType* copy_methods = RelocatedCopyOf(orig_methods);
for (size_t j = 0, num = orig_dex_cache->NumResolvedMethods(); j != num; ++j) {
- ArtMethod* orig = mirror::DexCache::GetElementPtrSize(orig_methods, j, pointer_size);
- ArtMethod* copy = RelocatedAddressOfPointer(orig);
- mirror::DexCache::SetElementPtrSize(copy_methods, j, copy, pointer_size);
+ mirror::MethodDexCachePair orig =
+ mirror::DexCache::GetNativePairPtrSize(orig_methods, j, pointer_size);
+ mirror::MethodDexCachePair copy(RelocatedAddressOfPointer(orig.object), orig.index);
+ mirror::DexCache::SetNativePairPtrSize(copy_methods, j, copy, pointer_size);
}
}
mirror::FieldDexCacheType* orig_fields = orig_dex_cache->GetResolvedFields();