From 8ccc3f5d06fd217cdaabd37e743adab2031d3720 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 19 Mar 2014 10:34:11 +0000 Subject: 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 --- compiler/optimizing/optimizing_compiler.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 334b185b44..d19c40c291 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, -- cgit v1.2.3-59-g8ed1b