summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Narayan Kamath <narayan@google.com> 2015-12-24 11:55:50 +0000
committer Narayan Kamath <narayan@google.com> 2015-12-24 11:55:50 +0000
commitfed399c39a89a04966cf9c7da300c8a1d6404453 (patch)
treeb1c6399751c98babd3839bd4d5ff4a1f6a5c274c /compiler/optimizing
parent58b2329de74a73d2f0a7ed001e50cc39df33d9da (diff)
parent7f65b4669c52976cd5713dae47b901707ed77110 (diff)
Merge internal master into aosp/master.
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/inliner.cc12
-rw-r--r--compiler/optimizing/optimizing_compiler.cc6
2 files changed, 17 insertions, 1 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index a4dcb3aeba..98421373e3 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -372,6 +372,18 @@ bool HInliner::TryInlinePolymorphicCall(HInvoke* invoke_instruction ATTRIBUTE_UN
bool HInliner::TryInline(HInvoke* invoke_instruction, ArtMethod* method, bool do_rtp) {
const DexFile& caller_dex_file = *caller_compilation_unit_.GetDexFile();
+
+ // Check whether we're allowed to inline. The outermost compilation unit is the relevant
+ // dex file here (though the transitivity of an inline chain would allow checking the calller).
+ if (!compiler_driver_->MayInline(method->GetDexFile(),
+ outer_compilation_unit_.GetDexFile())) {
+ VLOG(compiler) << "Won't inline " << PrettyMethod(method) << " in "
+ << outer_compilation_unit_.GetDexFile()->GetLocation() << " ("
+ << caller_compilation_unit_.GetDexFile()->GetLocation() << ") from "
+ << method->GetDexFile()->GetLocation();
+ return false;
+ }
+
uint32_t method_index = FindMethodIndexIn(
method, caller_dex_file, invoke_instruction->GetDexMethodIndex());
if (method_index == DexFile::kDexNoIndex) {
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 831b626c4f..dd1d193ca3 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -880,7 +880,11 @@ Compiler* CreateOptimizingCompiler(CompilerDriver* driver) {
bool IsCompilingWithCoreImage() {
const std::string& image = Runtime::Current()->GetImageLocation();
- return EndsWith(image, "core.art") || EndsWith(image, "core-optimizing.art");
+ // TODO: This is under-approximating...
+ if (EndsWith(image, "core.art") || EndsWith(image, "core-optimizing.art")) {
+ return true;
+ }
+ return false;
}
bool OptimizingCompiler::JitCompile(Thread* self,