diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2016-11-14 12:41:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-11-14 12:41:12 +0000 |
commit | 81cae78d1853893ff9c3ecea4b5100002a538eb7 (patch) | |
tree | d32c8f7e57449381511ffb206f4a335c157ae597 /compiler/optimizing/sharpening.cc | |
parent | e8fc2cedb85ce4a6747cddbbf4cf33288e0ba5b9 (diff) | |
parent | 3395fbc20bcd20948bec8958db91b304c17cacd8 (diff) |
Merge "Revert "Revert "Revert "JIT root tables.""""
Diffstat (limited to 'compiler/optimizing/sharpening.cc')
-rw-r--r-- | compiler/optimizing/sharpening.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index 15254edcab..63e4ca674e 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -281,8 +281,7 @@ void HSharpening::ProcessLoadString(HLoadString* load_string) { : hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file)); if (codegen_->GetCompilerOptions().IsBootImage()) { - // Compiling boot image. Resolve the string and allocate it if needed, to ensure - // the string will be added to the boot image. + // Compiling boot image. Resolve the string and allocate it if needed. DCHECK(!runtime->UseJitCompilation()); mirror::String* string = class_linker->ResolveString(dex_file, string_index, dex_cache); CHECK(string != nullptr); @@ -298,14 +297,10 @@ void HSharpening::ProcessLoadString(HLoadString* load_string) { } else if (runtime->UseJitCompilation()) { // TODO: Make sure we don't set the "compile PIC" flag for JIT as that's bogus. // DCHECK(!codegen_->GetCompilerOptions().GetCompilePic()); - mirror::String* string = class_linker->LookupString(dex_file, string_index, dex_cache); - if (string != nullptr) { - if (runtime->GetHeap()->ObjectIsInBootImageSpace(string)) { - desired_load_kind = HLoadString::LoadKind::kBootImageAddress; - address = reinterpret_cast64<uint64_t>(string); - } else { - desired_load_kind = HLoadString::LoadKind::kJitTableAddress; - } + mirror::String* string = dex_cache->GetResolvedString(string_index); + if (string != nullptr && runtime->GetHeap()->ObjectIsInBootImageSpace(string)) { + desired_load_kind = HLoadString::LoadKind::kBootImageAddress; + address = reinterpret_cast64<uint64_t>(string); } } else { // AOT app compilation. Try to lookup the string without allocating if not found. @@ -327,7 +322,6 @@ void HSharpening::ProcessLoadString(HLoadString* load_string) { case HLoadString::LoadKind::kBootImageLinkTimePcRelative: case HLoadString::LoadKind::kBssEntry: case HLoadString::LoadKind::kDexCacheViaMethod: - case HLoadString::LoadKind::kJitTableAddress: load_string->SetLoadKindWithStringReference(load_kind, dex_file, string_index); break; case HLoadString::LoadKind::kBootImageAddress: |