diff options
Diffstat (limited to 'compiler/optimizing/inliner.cc')
| -rw-r--r-- | compiler/optimizing/inliner.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 82d63573bc..968fe3e73c 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -85,9 +85,11 @@ bool HInliner::TryInline(HInvoke* invoke_instruction, return false; } - bool can_use_dex_cache = true; if (resolved_method->GetDexFile()->GetLocation().compare(outer_dex_file.GetLocation()) != 0) { - can_use_dex_cache = false; + VLOG(compiler) << "Did not inline " + << PrettyMethod(method_index, outer_dex_file) + << " because it is in a different dex file"; + return false; } const DexFile::CodeItem* code_item = resolved_method->GetCodeItem(); @@ -122,7 +124,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction, return false; } - if (!TryBuildAndInline(resolved_method, invoke_instruction, method_index, can_use_dex_cache)) { + if (!TryBuildAndInline(resolved_method, invoke_instruction, method_index)) { resolved_method->SetShouldNotInline(); return false; } @@ -134,8 +136,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction, bool HInliner::TryBuildAndInline(Handle<mirror::ArtMethod> resolved_method, HInvoke* invoke_instruction, - uint32_t method_index, - bool can_use_dex_cache) const { + uint32_t method_index) const { ScopedObjectAccess soa(Thread::Current()); const DexFile::CodeItem* code_item = resolved_method->GetCodeItem(); const DexFile& outer_dex_file = *outer_compilation_unit_.GetDexFile(); @@ -144,10 +145,10 @@ bool HInliner::TryBuildAndInline(Handle<mirror::ArtMethod> resolved_method, nullptr, outer_compilation_unit_.GetClassLoader(), outer_compilation_unit_.GetClassLinker(), - *resolved_method->GetDexFile(), + outer_dex_file, code_item, resolved_method->GetDeclaringClass()->GetDexClassDefIndex(), - resolved_method->GetDexMethodIndex(), + method_index, resolved_method->GetAccessFlags(), nullptr); @@ -158,7 +159,7 @@ bool HInliner::TryBuildAndInline(Handle<mirror::ArtMethod> resolved_method, HGraphBuilder builder(callee_graph, &dex_compilation_unit, &outer_compilation_unit_, - resolved_method->GetDexFile(), + &outer_dex_file, compiler_driver_, &inline_stats); @@ -199,7 +200,7 @@ bool HInliner::TryBuildAndInline(Handle<mirror::ArtMethod> resolved_method, if (depth_ + 1 < kDepthLimit) { HInliner inliner( - callee_graph, dex_compilation_unit, compiler_driver_, stats_, depth_ + 1); + callee_graph, outer_compilation_unit_, compiler_driver_, stats_, depth_ + 1); inliner.Run(); } @@ -234,13 +235,6 @@ bool HInliner::TryBuildAndInline(Handle<mirror::ArtMethod> resolved_method, << " needs an environment"; return false; } - - if (!can_use_dex_cache && current->NeedsDexCache()) { - VLOG(compiler) << "Method " << PrettyMethod(method_index, outer_dex_file) - << " could not be inlined because " << current->DebugName() - << " it is in a different dex file and requires access to the dex cache"; - return false; - } } } |