diff options
author | Calin Juravle <calin@google.com> | 2015-02-20 10:40:50 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-20 10:40:51 +0000 |
commit | 4fe292e2b6ba3980605373f183055a374084c65b (patch) | |
tree | cc689a549944d5302400aa155722e4e8715211b6 /compiler/optimizing/optimizing_compiler.cc | |
parent | 76f82fc75f245101828e2fdbbdec676af1717f0b (diff) | |
parent | acf735c13998ad2a175f5a17e7bfce220073279d (diff) |
Merge "Reference type propagation"
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 080d6e01af..2fef8c7b3a 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -201,6 +201,7 @@ class OptimizingCompiler FINAL : public Compiler { CompiledMethod* CompileOptimized(HGraph* graph, CodeGenerator* codegen, CompilerDriver* driver, + const DexFile& dex_file, const DexCompilationUnit& dex_compilation_unit, PassInfoPrinter* pass_info) const; @@ -293,13 +294,15 @@ static void RunOptimizations(HOptimization* optimizations[], static void RunOptimizations(HGraph* graph, CompilerDriver* driver, OptimizingCompilerStats* stats, + const DexFile& dex_file, const DexCompilationUnit& dex_compilation_unit, - PassInfoPrinter* pass_info_printer) { + PassInfoPrinter* pass_info_printer, + StackHandleScopeCollection* handles) { SsaRedundantPhiElimination redundant_phi(graph); SsaDeadPhiElimination dead_phi(graph); HDeadCodeElimination dce(graph); HConstantFolding fold1(graph); - InstructionSimplifier simplify1(graph); + InstructionSimplifier simplify1(graph, stats); HInliner inliner(graph, dex_compilation_unit, driver, stats); @@ -308,8 +311,8 @@ static void RunOptimizations(HGraph* graph, GVNOptimization gvn(graph, side_effects); LICM licm(graph, side_effects); BoundsCheckElimination bce(graph); - ReferenceTypePropagation type_propagation(graph); - InstructionSimplifier simplify2(graph, "instruction_simplifier_after_types"); + ReferenceTypePropagation type_propagation(graph, dex_file, dex_compilation_unit, handles); + InstructionSimplifier simplify2(graph, stats, "instruction_simplifier_after_types"); IntrinsicsRecognizer intrinsics(graph, dex_compilation_unit.GetDexFile(), driver); @@ -348,10 +351,12 @@ static ArrayRef<const uint8_t> AlignVectorSize(std::vector<uint8_t>& vector) { CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph, CodeGenerator* codegen, CompilerDriver* compiler_driver, + const DexFile& dex_file, const DexCompilationUnit& dex_compilation_unit, PassInfoPrinter* pass_info_printer) const { - RunOptimizations( - graph, compiler_driver, &compilation_stats_, dex_compilation_unit, pass_info_printer); + StackHandleScopeCollection handles(Thread::Current()); + RunOptimizations(graph, compiler_driver, &compilation_stats_, + dex_file, dex_compilation_unit, pass_info_printer, &handles); PrepareForRegisterAllocation(graph).Run(); SsaLivenessAnalysis liveness(*graph, codegen); @@ -515,6 +520,7 @@ CompiledMethod* OptimizingCompiler::Compile(const DexFile::CodeItem* code_item, return CompileOptimized(graph, codegen.get(), compiler_driver, + dex_file, dex_compilation_unit, &pass_info_printer); } else if (shouldOptimize && RegisterAllocator::Supports(instruction_set)) { |