summaryrefslogtreecommitdiff
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-01-27 10:37:34 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-01-27 10:37:36 +0000
commitca21dc47adeed92a15a9d3fd090bdd0e6654679c (patch)
tree59aca3792abfa47c7424e4dac13248651e4662b2 /compiler/image_writer.cc
parent67c60656639acc92dca2ae8713add7d22683c7b9 (diff)
parente8fcd013493b800227bd7ea5f38f6cc27e9b90d1 (diff)
Merge "Revert "Revert "CHA for abstract methods."""
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 15e4cd8e9c..c72edb18a3 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -2348,6 +2348,16 @@ const uint8_t* ImageWriter::GetQuickCode(ArtMethod* method,
void ImageWriter::CopyAndFixupMethod(ArtMethod* orig,
ArtMethod* copy,
const ImageInfo& image_info) {
+ if (orig->IsAbstract()) {
+ // Ignore the single-implementation info for abstract method.
+ // Do this on orig instead of copy, otherwise there is a crash due to methods
+ // are copied before classes.
+ // TODO: handle fixup of single-implementation method for abstract method.
+ orig->SetHasSingleImplementation(false);
+ orig->SetSingleImplementation(
+ nullptr, Runtime::Current()->GetClassLinker()->GetImagePointerSize());
+ }
+
memcpy(copy, orig, ArtMethod::Size(target_ptr_size_));
copy->SetDeclaringClass(GetImageAddress(orig->GetDeclaringClassUnchecked()));