summaryrefslogtreecommitdiff
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 7634510457..cdb57a98ad 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -48,12 +48,12 @@
#include "intern_table.h"
#include "linear_alloc.h"
#include "lock_word.h"
-#include "mirror/abstract_method.h"
#include "mirror/array-inl.h"
#include "mirror/class-inl.h"
#include "mirror/class_loader.h"
#include "mirror/dex_cache.h"
#include "mirror/dex_cache-inl.h"
+#include "mirror/executable.h"
#include "mirror/method.h"
#include "mirror/object-inl.h"
#include "mirror/object_array-inl.h"
@@ -868,7 +868,7 @@ void ImageWriter::PruneNonImageClasses() {
// Clear references to removed classes from the DexCaches.
ArtMethod* resolution_method = runtime->GetResolutionMethod();
- ScopedAssertNoThreadSuspension sa(self, __FUNCTION__);
+ ScopedAssertNoThreadSuspension sa(__FUNCTION__);
ReaderMutexLock mu(self, *Locks::classlinker_classes_lock_); // For ClassInClassTable
ReaderMutexLock mu2(self, *class_linker->DexLock());
for (const ClassLinker::DexCacheData& data : class_linker->GetDexCachesData()) {
@@ -1989,14 +1989,10 @@ void ImageWriter::FixupObject(Object* orig, Object* copy) {
} else {
if (klass == mirror::Method::StaticClass() || klass == mirror::Constructor::StaticClass()) {
// Need to go update the ArtMethod.
- auto* dest = down_cast<mirror::AbstractMethod*>(copy);
- auto* src = down_cast<mirror::AbstractMethod*>(orig);
+ auto* dest = down_cast<mirror::Executable*>(copy);
+ auto* src = down_cast<mirror::Executable*>(orig);
ArtMethod* src_method = src->GetArtMethod();
- auto it = native_object_relocations_.find(src_method);
- CHECK(it != native_object_relocations_.end())
- << "Missing relocation for AbstractMethod.artMethod " << PrettyMethod(src_method);
- dest->SetArtMethod(
- reinterpret_cast<ArtMethod*>(global_image_begin_ + it->second.offset));
+ dest->SetArtMethod(GetImageMethodAddress(src_method));
} else if (!klass->IsArrayClass()) {
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
if (klass == class_linker->GetClassRoot(ClassLinker::kJavaLangDexCache)) {