summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2015-04-24 18:20:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-24 18:20:54 +0000
commit3507b795c034617e1c94fc9544a208d6c6f75735 (patch)
treee0675b7691662a452a2bb48ebbf5410ceac51c85 /compiler
parenteb5459ca861b58ee8a9907789f11400dcdddb87b (diff)
parent5f02c6caf9f38be49e655f8bdeeeb99b6faf9383 (diff)
downloadart-3507b795c034617e1c94fc9544a208d6c6f75735.tar.gz
art-3507b795c034617e1c94fc9544a208d6c6f75735.tar.bz2
art-3507b795c034617e1c94fc9544a208d6c6f75735.zip
Merge "Reduce the number of explicit clinit checks for static invokes."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/builder.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index bb2080766d..2f8a605ab4 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -666,9 +666,10 @@ bool HGraphBuilder::BuildInvoke(const Instruction& instruction,
&storage_index);
}
- if (is_referrer_class) {
- // If the declaring class is the referrer class, no class
- // initialization is needed before the static method call.
+ if (referrer_class.Get()->IsSubClass(resolved_method->GetDeclaringClass())) {
+ // If the referrer class is the declaring class or a subclass
+ // of the declaring class, no class initialization is needed
+ // before the static method call.
clinit_check_requirement = HInvokeStaticOrDirect::ClinitCheckRequirement::kNone;
} else if (storage_index != DexFile::kDexNoIndex) {
// If the method's class type index is available, check