diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/dex/mir_graph.cc | 8 | ||||
-rw-r--r-- | compiler/dex/mir_graph.h | 9 | ||||
-rw-r--r-- | compiler/dex/quick/codegen_util.cc | 7 |
3 files changed, 14 insertions, 10 deletions
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index 90e68abad8..264604c355 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -107,6 +107,7 @@ MIRGraph::MIRGraph(CompilationUnit* cu, ArenaAllocator* arena) method_sreg_(0), attributes_(METHOD_IS_LEAF), // Start with leaf assumption, change on encountering invoke. checkstats_(NULL), + special_case_(kNoHandler), arena_(arena) { try_block_addr_ = new (arena_) ArenaBitVector(arena_, 0, true /* expandable */); } @@ -590,9 +591,6 @@ void MIRGraph::InlineMethod(const DexFile::CodeItem* code_item, uint32_t access_ bool* dead_pattern = static_cast<bool*>(arena_->NewMem(sizeof(bool) * num_patterns, true, ArenaAllocator::kAllocMisc)); - SpecialCaseHandler special_case = kNoHandler; - // FIXME - wire this up - (void)special_case; int pattern_pos = 0; /* Parse all instructions and put them into containing basic blocks */ @@ -614,12 +612,12 @@ void MIRGraph::InlineMethod(const DexFile::CodeItem* code_item, uint32_t access_ /* Possible simple method? */ if (live_pattern) { live_pattern = false; - special_case = kNoHandler; + special_case_ = kNoHandler; for (int i = 0; i < num_patterns; i++) { if (!dead_pattern[i]) { if (special_patterns[i].opcodes[pattern_pos] == opcode) { live_pattern = true; - special_case = special_patterns[i].handler_code; + special_case_ = special_patterns[i].handler_code; } else { dead_pattern[i] = true; } diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 9c63d9c5ed..342d2a296a 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -509,6 +509,14 @@ class MIRGraph { return reg_location_[method_sreg_]; } + bool IsSpecialCase() { + return special_case_ != kNoHandler; + } + + SpecialCaseHandler GetSpecialCase() { + return special_case_; + } + void BasicBlockCombine(); void CodeLayout(); void DumpCheckStats(); @@ -655,6 +663,7 @@ class MIRGraph { int method_sreg_; unsigned int attributes_; Checkstats* checkstats_; + SpecialCaseHandler special_case_; ArenaAllocator* arena_; }; diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index 630e294b37..9e9b39e3ef 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -950,16 +950,13 @@ void Mir2Lir::Materialize() { /* Allocate Registers using simple local allocation scheme */ SimpleRegAlloc(); - //FIXME: re-enable by retrieving from mir_graph - SpecialCaseHandler special_case = kNoHandler; - - if (special_case != kNoHandler) { + 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; */ - SpecialMIR2LIR(special_case); + SpecialMIR2LIR(mir_graph_->GetSpecialCase()); } /* Convert MIR to LIR, etc. */ |