diff options
Diffstat (limited to 'compiler/oat_writer.cc')
| -rw-r--r-- | compiler/oat_writer.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 8273b15667..8a809822df 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -1189,8 +1189,13 @@ class OatWriter::WriteCodeMethodVisitor : public OatDexMethodVisitor { } mirror::String* GetTargetString(const LinkerPatch& patch) SHARED_REQUIRES(Locks::mutator_lock_) { - mirror::DexCache* dex_cache = GetDexCache(patch.TargetStringDexFile()); - mirror::String* string = dex_cache->GetResolvedString(patch.TargetStringIndex()); + ScopedObjectAccessUnchecked soa(Thread::Current()); + StackHandleScope<1> hs(soa.Self()); + ClassLinker* linker = Runtime::Current()->GetClassLinker(); + Handle<mirror::DexCache> dex_cache(hs.NewHandle(GetDexCache(patch.TargetStringDexFile()))); + mirror::String* string = linker->LookupString(*patch.TargetStringDexFile(), + patch.TargetStringIndex(), + dex_cache); DCHECK(string != nullptr); DCHECK(writer_->HasBootImage() || Runtime::Current()->GetHeap()->ObjectIsInBootImageSpace(string)); |