summaryrefslogtreecommitdiff
path: root/compiler/optimizing/sharpening.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-08-30 10:23:01 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-10-24 10:48:23 -0700
commit1ceb37c75544c5285fb87f27e1d9fa7261ced60c (patch)
treea2c672170bb8424a148298706c6fd71d892a1b6e /compiler/optimizing/sharpening.cc
parent3667e26de4856cccf24bcbab54ad3349a05267c0 (diff)
Remove unnecessary load class for new instance
Remove the load class for new instance if the load class has only one use and can not throw. Previously many were not removed due to MarkInDexCache nulling out the environment of the HLoadClass and causing CanMoveClinitCheck to fail. Also keep track of initialized HLoadClass and always remove clinit checks for these. Added checker regression test. Code size savings: ARM64 CC boot.oat: 47896936 -> 47642488 (-0.53%) Savings from IsInitialized optimization: 65984 bytes Performance unmeasured, probably faster due to removing unnecessary work. Test: test-art-host with CC baker Bug: 29516974 Change-Id: I43358762ffb380ebe7e6518d0d440a5e1cc03b61
Diffstat (limited to 'compiler/optimizing/sharpening.cc')
-rw-r--r--compiler/optimizing/sharpening.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc
index df1b351249..d938a70579 100644
--- a/compiler/optimizing/sharpening.cc
+++ b/compiler/optimizing/sharpening.cc
@@ -162,7 +162,6 @@ void HSharpening::ProcessLoadClass(HLoadClass* load_class) {
? compilation_unit_.GetDexCache()
: hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file));
mirror::Class* klass = dex_cache->GetResolvedType(type_index);
-
if (codegen_->GetCompilerOptions().IsBootImage()) {
// Compiling boot image. Check if the class is a boot image class.
DCHECK(!runtime->UseJitCompilation());