diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-05-30 16:31:49 +0000 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-05-30 16:31:49 +0000 |
commit | fb241b6e93f8b54122b978ad0df23a9e514eef0f (patch) | |
tree | 3564e74f52a40a242e6be2bbb03f1e31a2428e3a /compiler/image_writer.cc | |
parent | fc3b871ca37593561e3b67006771710bf4d174ea (diff) | |
download | art-fb241b6e93f8b54122b978ad0df23a9e514eef0f.zip art-fb241b6e93f8b54122b978ad0df23a9e514eef0f.tar.gz art-fb241b6e93f8b54122b978ad0df23a9e514eef0f.tar.bz2 |
Revert "Clean up image writer patching."
This reverts commit fc3b871ca37593561e3b67006771710bf4d174ea.
Change-Id: I4d1250f3adcd17fcd1b63496816e098db4d5be3c
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r-- | compiler/image_writer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index e37f943..e909c97 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -748,12 +748,12 @@ void ImageWriter::PatchOatCodeAndMethods() { bool is_quick_offset = false; if (quick_code == reinterpret_cast<uintptr_t>(GetQuickToInterpreterBridge())) { is_quick_offset = true; - code_offset = quick_to_interpreter_bridge_offset_; + code_offset = PointerToLowMemUInt32(GetOatAddress(quick_to_interpreter_bridge_offset_)); } else if (quick_code == reinterpret_cast<uintptr_t>(class_linker->GetQuickGenericJniTrampoline())) { CHECK(target->IsNative()); is_quick_offset = true; - code_offset = quick_generic_jni_trampoline_offset_; + code_offset = PointerToLowMemUInt32(GetOatAddress(quick_generic_jni_trampoline_offset_)); } uintptr_t value; if (patch->IsRelative()) { @@ -763,10 +763,10 @@ void ImageWriter::PatchOatCodeAndMethods() { patch->GetReferrerClassDefIdx(), patch->GetReferrerMethodIdx()); if (is_quick_offset) { + quick_code = code_offset; // If its a quick offset it means that we are doing a relative patch from the class linker // oat_file to the image writer oat_file so we need to adjust the quick oat code to be the // one in the image writer oat_file. - quick_code = PointerToLowMemUInt32(GetOatAddress(code_offset)); quick_oat_code = reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(quick_oat_code) + reinterpret_cast<uintptr_t>(oat_data_begin_) - code_base); @@ -775,7 +775,7 @@ void ImageWriter::PatchOatCodeAndMethods() { uintptr_t patch_location = base + patch->GetLiteralOffset(); value = quick_code - patch_location + patch->RelativeOffset(); } else { - value = PointerToLowMemUInt32(GetOatAddress(code_offset)); + value = code_offset; } SetPatchLocation(patch, value); } |