From 95026871a4745b417b9b776966f26666d1c1f737 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 9 Sep 2016 09:16:31 +0000 Subject: Revert "Revert "Re-enable boot image string sharpening."" The reason for the revert was a transaction bug fixed by https://android-review.googlesource.com/271008 Bug: 20323084 Bug: 31239436 This reverts commit f508c565b13585a766719b87a00e3c2a4200abe0. Change-Id: I2f5995b55ccbf58b888db3f0ab64d6186e400a92 --- compiler/optimizing/sharpening.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing') 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()); -- cgit v1.2.3-59-g8ed1b