summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-08-30 17:36:24 +0100
committer Vladimir Marko <vmarko@google.com> 2016-08-30 19:11:58 +0100
commit9ed010e43c729a801089307c55f20f6d4df8271c (patch)
tree3643a6bab8c0d0068e7f132827e329bb94e9ca49 /compiler/optimizing
parent9495e0c56b25349220aed7adb997d81f9b0c86cc (diff)
Re-enable boot image string sharpening.
Test: Run ART test suite with ART_TEST_PIC_IMAGE=true on host and Nexus 9. Bug: 20323084 Change-Id: Ifc10e4b6f5078f599711bd84be0cec53494af3af
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/sharpening.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc
index 6effc306dc..40fff8af32 100644
--- a/compiler/optimizing/sharpening.cc
+++ b/compiler/optimizing/sharpening.cc
@@ -295,7 +295,15 @@ void HSharpening::ProcessLoadString(HLoadString* load_string) {
DCHECK(!runtime->UseJitCompilation());
mirror::String* string = class_linker->ResolveString(dex_file, string_index, dex_cache);
CHECK(string != nullptr);
- // TODO: In follow up CL, add PcRelative and Address back in.
+ if (compiler_driver_->GetSupportBootImageFixup()) {
+ DCHECK(ContainsElement(compiler_driver_->GetDexFilesForOatFile(), &dex_file));
+ desired_load_kind = codegen_->GetCompilerOptions().GetCompilePic()
+ ? HLoadString::LoadKind::kBootImageLinkTimePcRelative
+ : HLoadString::LoadKind::kBootImageLinkTimeAddress;
+ } else {
+ // MIPS64 or compiler_driver_test. Do not sharpen.
+ DCHECK_EQ(desired_load_kind, HLoadString::LoadKind::kDexCacheViaMethod);
+ }
} 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());