diff options
| author | 2013-11-27 17:04:20 +0000 | |
|---|---|---|
| committer | 2013-12-17 18:24:13 +0000 | |
| commit | 5816ed48bc339c983b40dc493e96b97821ce7966 (patch) | |
| tree | 1682c6d13ae274132f4e3630f9b20ab4bdb291a3 /compiler/dex/quick/codegen_util.cc | |
| parent | 2b5eaa2b49f7489bafdadc4b4463ae27e4261817 (diff) | |
Detect special methods at the end of verification.
This moves special method handling to method inliner
and prepares for eventual inlining of these methods.
Change-Id: I51c51b940fb7bc714e33135cd61be69467861352
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
| -rw-r--r-- | compiler/dex/quick/codegen_util.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index bae8ff339a..65286d5d2f 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -19,6 +19,8 @@ #include "gc_map.h" #include "mapping_table.h" #include "mir_to_lir-inl.h" +#include "dex/quick/dex_file_method_inliner.h" +#include "dex/quick/dex_file_to_method_inliner_map.h" #include "dex/verified_methods_data.h" #include "verifier/dex_gc_map.h" #include "verifier/method_verifier.h" @@ -983,8 +985,7 @@ Mir2Lir::Mir2Lir(CompilationUnit* cu, MIRGraph* mir_graph, ArenaAllocator* arena core_spill_mask_(0), fp_spill_mask_(0), first_lir_insn_(NULL), - last_lir_insn_(NULL), - inliner_(nullptr) { + last_lir_insn_(NULL) { promotion_map_ = static_cast<PromotionMap*> (arena_->Alloc((cu_->num_dalvik_registers + cu_->num_compiler_temps + 1) * sizeof(promotion_map_[0]), ArenaAllocator::kAllocRegAlloc)); @@ -1000,15 +1001,16 @@ void Mir2Lir::Materialize() { /* Allocate Registers using simple local allocation scheme */ SimpleRegAlloc(); - if (mir_graph_->IsSpecialCase()) { - /* - * Custom codegen for special cases. If for any reason the - * special codegen doesn't succeed, first_lir_insn_ will - * set to NULL; - */ - cu_->NewTimingSplit("SpecialMIR2LIR"); - SpecialMIR2LIR(mir_graph_->GetSpecialCase()); - } + /* + * Custom codegen for special cases. If for any reason the + * special codegen doesn't succeed, first_lir_insn_ will + * set to NULL; + */ + // TODO: Clean up GenSpecial() and return true only if special implementation is emitted. + // Currently, GenSpecial() returns IsSpecial() but doesn't check after SpecialMIR2LIR(). + DCHECK(cu_->compiler_driver->GetMethodInlinerMap() != nullptr); + cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file) + ->GenSpecial(this, cu_->method_idx); /* Convert MIR to LIR, etc. */ if (first_lir_insn_ == NULL) { |