summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-10 19:14:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-10 19:14:25 +0000
commita29d93b380c9aeb8270e281aefbdd0c77a430d43 (patch)
tree22fb9344bd5495cf6a093913e9cf71967b42ab4f /compiler/optimizing/optimizing_compiler.cc
parent1e7e85a40744ddd0c36b206d0960fc3cf24a7e62 (diff)
parentc2bcafe225d672611284ef247b777b9b19817c7d (diff)
downloadart-a29d93b380c9aeb8270e281aefbdd0c77a430d43.zip
art-a29d93b380c9aeb8270e281aefbdd0c77a430d43.tar.gz
art-a29d93b380c9aeb8270e281aefbdd0c77a430d43.tar.bz2
Merge "ART: Refactor CompileOptimized"
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index a428c75..c2b5c99 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -357,9 +357,20 @@ static ArrayRef<const uint8_t> AlignVectorSize(std::vector<uint8_t>& vector) {
return ArrayRef<const uint8_t>(vector);
}
-// TODO: The function below uses too much stack space.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
+static void AllocateRegisters(HGraph* graph,
+ CodeGenerator* codegen,
+ PassInfoPrinter* pass_info_printer) {
+ PrepareForRegisterAllocation(graph).Run();
+ SsaLivenessAnalysis liveness(*graph, codegen);
+ {
+ PassInfo pass_info(SsaLivenessAnalysis::kLivenessPassName, pass_info_printer);
+ liveness.Analyze();
+ }
+ {
+ PassInfo pass_info(RegisterAllocator::kRegisterAllocatorPassName, pass_info_printer);
+ RegisterAllocator(graph->GetArena(), codegen, liveness).AllocateRegisters();
+ }
+}
CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph,
CodeGenerator* codegen,
@@ -371,16 +382,7 @@ CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph,
RunOptimizations(graph, compiler_driver, &compilation_stats_,
dex_file, dex_compilation_unit, pass_info_printer, &handles);
- PrepareForRegisterAllocation(graph).Run();
- SsaLivenessAnalysis liveness(*graph, codegen);
- {
- PassInfo pass_info(SsaLivenessAnalysis::kLivenessPassName, pass_info_printer);
- liveness.Analyze();
- }
- {
- PassInfo pass_info(RegisterAllocator::kRegisterAllocatorPassName, pass_info_printer);
- RegisterAllocator(graph->GetArena(), codegen, liveness).AllocateRegisters();
- }
+ AllocateRegisters(graph, codegen, pass_info_printer);
CodeVectorAllocator allocator;
codegen->CompileOptimized(&allocator);
@@ -413,8 +415,6 @@ CompiledMethod* OptimizingCompiler::CompileOptimized(HGraph* graph,
ArrayRef<const LinkerPatch>());
}
-#pragma GCC diagnostic pop
-
CompiledMethod* OptimizingCompiler::CompileBaseline(
CodeGenerator* codegen,
CompilerDriver* compiler_driver,