Dex compiler: re-enable method pattern matching
The dex compiler's mechanism to detect simple methods and emit
streamlined code was disabled during the last big restructuring
(there was a question of how to make it useful for Portable as
well as Quick). This CL does not address the Portable question,
but turns the optimization back on for Quick.
See b/9428200
Change-Id: I9f25b41219d7a243ec64efb18278e5a874766f4d
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 90e68ab..264604c 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -107,6 +107,7 @@
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 @@
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 @@
/* 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;
}