Compiler cleanup: remove some old JIT leftovers.
The JIT was designed to allow any code emitter (for any reason)
to decline to complete a codegen request. The outer driver
would then detect if a codegen request wasn't completed and
in that case generate bail-out code to the interpreter or
simply end the trace early.
This was quite useful for the JIT, but has no value in an
ahead-of-time compiler (with the exception of special inline
cases - those are still optional). Codegen requests must succeed or
die. This CL removes some of the bool success reporting from
inherited Gen routines.
Change-Id: I0237bbd82cc2d548f85dda8f7231126337976e8a
diff --git a/src/compiler/codegen/mir_to_lir.cc b/src/compiler/codegen/mir_to_lir.cc
index 96de65e..23c3fe7 100644
--- a/src/compiler/codegen/mir_to_lir.cc
+++ b/src/compiler/codegen/mir_to_lir.cc
@@ -28,11 +28,10 @@
* load/store utilities here, or target-dependent genXX() handlers
* when necessary.
*/
-static bool CompileDalvikInstruction(CompilationUnit* cu, MIR* mir, BasicBlock* bb,
+static void CompileDalvikInstruction(CompilationUnit* cu, MIR* mir, BasicBlock* bb,
LIR* label_list)
{
Codegen* cg = cu->cg.get();
- bool res = false; // Assume success
RegLocation rl_src[3];
RegLocation rl_dest = GetBadLoc();
RegLocation rl_result = GetBadLoc();
@@ -265,7 +264,7 @@
case Instruction::CMPG_FLOAT:
case Instruction::CMPL_DOUBLE:
case Instruction::CMPG_DOUBLE:
- res = cg->GenCmpFP(cu, opcode, rl_dest, rl_src[0], rl_src[1]);
+ cg->GenCmpFP(cu, opcode, rl_dest, rl_src[0], rl_src[1]);
break;
case Instruction::CMP_LONG:
@@ -484,20 +483,20 @@
case Instruction::NEG_INT:
case Instruction::NOT_INT:
- res = cg->GenArithOpInt(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
+ cg->GenArithOpInt(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
break;
case Instruction::NEG_LONG:
case Instruction::NOT_LONG:
- res = cg->GenArithOpLong(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
+ cg->GenArithOpLong(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
break;
case Instruction::NEG_FLOAT:
- res = cg->GenArithOpFloat(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
+ cg->GenArithOpFloat(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
break;
case Instruction::NEG_DOUBLE:
- res = cg->GenArithOpDouble(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
+ cg->GenArithOpDouble(cu, opcode, rl_dest, rl_src[0], rl_src[0]);
break;
case Instruction::INT_TO_LONG:
@@ -660,9 +659,8 @@
break;
default:
- res = true;
+ LOG(FATAL) << "Unexpected opcode: " << opcode;
}
- return res;
}
// Process extended MIR instructions
@@ -780,12 +778,7 @@
continue;
}
- bool not_handled = CompileDalvikInstruction(cu, mir, bb, label_list);
- if (not_handled) {
- LOG(FATAL) << StringPrintf("%#06x: Opcode %#x (%s)",
- mir->offset, opcode,
- Instruction::Name(mir->dalvikInsn.opcode));
- }
+ CompileDalvikInstruction(cu, mir, bb, label_list);
}
if (head_lir) {