summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-10-15 18:02:30 +0100
committer Vladimir Marko <vmarko@google.com> 2015-10-23 14:45:32 +0100
commitdc151b2346bb8a4fdeed0c06e54c2fca21d59b5d (patch)
tree391d8ccb44ff9e6fc1c8fa8975e534e20cc002ff /compiler/optimizing/inliner.cc
parent823e693aa946ba75cd047429e1290011a2ed8729 (diff)
Optimizing: Determine invoke-static/-direct dispatch early.
Determine the dispatch type of invoke-static/-direct in a special pass right after the type inference. This allows the inliner to pass the "needs dex cache" check and inline more. It also allows the code generator to avoid requesting a register location for the ArtMethod* for kDexCachePcRelative and direct methods. The supported dispatch check handles also situations that the CompilerDriver currently doesn't allow. The cleanup of the CompilerDriver and required changes to Quick will come in a separate change. Change-Id: I3f8e903a119949e95871d8ab0a995f4731a13a07
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r--compiler/optimizing/inliner.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index e2aca3091f..0aaa6b3f2c 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -32,6 +32,7 @@
#include "optimizing_compiler.h"
#include "reference_type_propagation.h"
#include "register_allocator.h"
+#include "sharpening.h"
#include "ssa_phi_elimination.h"
#include "scoped_thread_state_change.h"
#include "thread.h"
@@ -396,12 +397,14 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
HDeadCodeElimination dce(callee_graph, stats_);
HConstantFolding fold(callee_graph);
ReferenceTypePropagation type_propagation(callee_graph, handles_);
+ HSharpening sharpening(callee_graph, codegen_, dex_compilation_unit, compiler_driver_);
InstructionSimplifier simplify(callee_graph, stats_);
IntrinsicsRecognizer intrinsics(callee_graph, compiler_driver_);
HOptimization* optimizations[] = {
&intrinsics,
&type_propagation,
+ &sharpening,
&simplify,
&dce,
&fold,
@@ -415,6 +418,7 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
size_t number_of_instructions_budget = kMaximumNumberOfHInstructions;
if (depth_ + 1 < compiler_driver_->GetCompilerOptions().GetInlineDepthLimit()) {
HInliner inliner(callee_graph,
+ codegen_,
outer_compilation_unit_,
dex_compilation_unit,
compiler_driver_,
@@ -484,7 +488,7 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
return false;
}
- if (!same_dex_file && current->NeedsDexCache()) {
+ if (!same_dex_file && current->NeedsDexCacheOfDeclaringClass()) {
VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file)
<< " could not be inlined because " << current->DebugName()
<< " it is in a different dex file and requires access to the dex cache";