diff options
author | 2017-01-27 10:37:34 +0000 | |
---|---|---|
committer | 2017-01-27 10:37:36 +0000 | |
commit | ca21dc47adeed92a15a9d3fd090bdd0e6654679c (patch) | |
tree | 59aca3792abfa47c7424e4dac13248651e4662b2 /compiler/image_writer.cc | |
parent | 67c60656639acc92dca2ae8713add7d22683c7b9 (diff) | |
parent | e8fcd013493b800227bd7ea5f38f6cc27e9b90d1 (diff) |
Merge "Revert "Revert "CHA for abstract methods."""
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r-- | compiler/image_writer.cc | 10 |
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())); |