summaryrefslogtreecommitdiff
path: root/patchoat/patchoat.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-04-27 21:03:42 +0000
committer Mathieu Chartier <mathieuc@google.com> 2016-04-28 15:18:10 -0700
commitd23d7d145c86975acbcc75505b8a323337066ac0 (patch)
treea62d4397dd54fa1ee65ce870e3c0b0b965f43868 /patchoat/patchoat.cc
parent85e47976a483844177eb486d6e501fa070fbe6e2 (diff)
Revert "Write conflict tables in image"
Some strange issues on angler. This reverts commit cda9386add68d94697449c6cb08b356747e55c21. (cherry picked from commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6) Change-Id: Iffd25c5fb732ff72b58c787c107dc33c56f8c8d4
Diffstat (limited to 'patchoat/patchoat.cc')
-rw-r--r--patchoat/patchoat.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index 0a7ffda3b4..93e40afea8 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -472,7 +472,8 @@ class PatchOatArtFieldVisitor : public ArtFieldVisitor {
void PatchOat::PatchArtFields(const ImageHeader* image_header) {
PatchOatArtFieldVisitor visitor(this);
- image_header->VisitPackedArtFields(&visitor, heap_->Begin());
+ const auto& section = image_header->GetImageSection(ImageHeader::kSectionArtFields);
+ section.VisitPackedArtFields(&visitor, heap_->Begin());
}
class PatchOatArtMethodVisitor : public ArtMethodVisitor {
@@ -489,20 +490,10 @@ class PatchOatArtMethodVisitor : public ArtMethodVisitor {
};
void PatchOat::PatchArtMethods(const ImageHeader* image_header) {
+ const auto& section = image_header->GetMethodsSection();
const size_t pointer_size = InstructionSetPointerSize(isa_);
PatchOatArtMethodVisitor visitor(this);
- image_header->VisitPackedArtMethods(&visitor, heap_->Begin(), pointer_size);
-}
-
-void PatchOat::PatchImtConflictTables(const ImageHeader* image_header) {
- const size_t pointer_size = InstructionSetPointerSize(isa_);
- // We can safely walk target image since the conflict tables are independent.
- image_header->VisitPackedImtConflictTables(
- [this](ArtMethod* method) {
- return RelocatedAddressOfPointer(method);
- },
- image_->Begin(),
- pointer_size);
+ section.VisitPackedArtMethods(&visitor, heap_->Begin(), pointer_size);
}
class FixupRootVisitor : public RootVisitor {
@@ -636,7 +627,6 @@ bool PatchOat::PatchImage(bool primary_image) {
PatchArtFields(image_header);
PatchArtMethods(image_header);
- PatchImtConflictTables(image_header);
PatchInternedStrings(image_header);
PatchClassTable(image_header);
// Patch dex file int/long arrays which point to ArtFields.
@@ -735,7 +725,6 @@ void PatchOat::FixupMethod(ArtMethod* object, ArtMethod* copy) {
RelocatedAddressOfPointer(object->GetDexCacheResolvedTypes(pointer_size)), pointer_size);
copy->SetEntryPointFromQuickCompiledCodePtrSize(RelocatedAddressOfPointer(
object->GetEntryPointFromQuickCompiledCodePtrSize(pointer_size)), pointer_size);
- // No special handling for IMT conflict table since all pointers are moved by the same offset.
copy->SetEntryPointFromJniPtrSize(RelocatedAddressOfPointer(
object->GetEntryPointFromJniPtrSize(pointer_size)), pointer_size);
}