summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-03-19 10:34:11 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-03-31 09:44:40 +0100
commit8ccc3f5d06fd217cdaabd37e743adab2031d3720 (patch)
treeec8c904baafb4d9b9bfd582245e2d780bcdfaade /compiler/optimizing/optimizing_compiler.cc
parentad174d1b54bf2fa477bec71a0ca93595f54b8fe9 (diff)
downloadart-8ccc3f5d06fd217cdaabd37e743adab2031d3720.zip
art-8ccc3f5d06fd217cdaabd37e743adab2031d3720.tar.gz
art-8ccc3f5d06fd217cdaabd37e743adab2031d3720.tar.bz2
Add support for invoke-static in optimizing compiler.
Support is limited to calls without parameters and returning void. For simplicity, we currently follow the Quick ABI. Change-Id: I54805161141b7eac5959f1cae0dc138dd0b2e8a5
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 334b185..d19c40c 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -62,17 +62,31 @@ CompiledMethod* OptimizingCompiler::TryCompile(CompilerDriver& driver,
nullptr, class_loader, art::Runtime::Current()->GetClassLinker(), dex_file, code_item,
class_def_idx, method_idx, access_flags, driver.GetVerifiedMethod(&dex_file, method_idx));
+ // For testing purposes, we put a special marker on method names that should be compiled
+ // with this compiler. This makes sure we're not regressing.
+ bool shouldCompile = dex_compilation_unit.GetSymbol().find("00024opt_00024") != std::string::npos;
+
ArenaPool pool;
ArenaAllocator arena(&pool);
- HGraphBuilder builder(&arena);
+ HGraphBuilder builder(&arena, &dex_compilation_unit, &dex_file);
HGraph* graph = builder.BuildGraph(*code_item);
if (graph == nullptr) {
+ if (shouldCompile) {
+ LOG(FATAL) << "Could not build graph in optimizing compiler";
+ }
return nullptr;
}
InstructionSet instruction_set = driver.GetInstructionSet();
+ // The optimizing compiler currently does not have a Thumb2 assembler.
+ if (instruction_set == kThumb2) {
+ instruction_set = kArm;
+ }
CodeGenerator* codegen = CodeGenerator::Create(&arena, graph, instruction_set);
if (codegen == nullptr) {
+ if (shouldCompile) {
+ LOG(FATAL) << "Could not find code generator for optimizing compiler";
+ }
return nullptr;
}
@@ -90,7 +104,7 @@ CompiledMethod* OptimizingCompiler::TryCompile(CompilerDriver& driver,
instruction_set,
allocator.GetMemory(),
codegen->GetFrameSize(),
- 0, /* GPR spill mask, unused */
+ codegen->GetCoreSpillMask(),
0, /* FPR spill mask, unused */
mapping_table,
vmap_table,