Remove the THROW_VERIFICATION_ERROR op and supporting code.

Change-Id: Idc40a2c379048c7e3d74f50b2bd765a507a417ce
diff --git a/src/compiler/CompilerIR.h b/src/compiler/CompilerIR.h
index 914d2ab..02c7621 100644
--- a/src/compiler/CompilerIR.h
+++ b/src/compiler/CompilerIR.h
@@ -688,7 +688,6 @@
   kThrowNullPointer,
   kThrowDivZero,
   kThrowArrayBounds,
-  kThrowVerificationError,
   kThrowNoSuchMethod,
   kThrowStackOverflow,
 };
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index 6cb701f..8c431f5 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -829,13 +829,6 @@
 #endif
 }
 
-void genThrowVerificationError(CompilationUnit* cUnit, int info1, int info2)
-{
-  callRuntimeHelperImmImm(cUnit,
-                          ENTRYPOINT_OFFSET(pThrowVerificationErrorFromCode),
-                          info1, info2);
-}
-
 void handleSuspendLaunchpads(CompilationUnit *cUnit)
 {
   LIR** suspendLabel = (LIR **)cUnit->suspendLaunchpads.elemList;
@@ -929,12 +922,6 @@
       case kThrowDivZero:
         funcOffset = ENTRYPOINT_OFFSET(pThrowDivZeroFromCode);
         break;
-      case kThrowVerificationError:
-        loadConstant(cUnit, rARG0, v1);
-        loadConstant(cUnit, rARG1, v2);
-        funcOffset =
-          ENTRYPOINT_OFFSET(pThrowVerificationErrorFromCode);
-        break;
       case kThrowNoSuchMethod:
         opRegCopy(cUnit, rARG0, v1);
         funcOffset =
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index 6b78765..c84d6d3 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -378,16 +378,6 @@
   defineValue(cUnit, res, rlDest.origSReg);
 }
 
-void convertThrowVerificationError(CompilationUnit* cUnit, int info1, int info2)
-{
-  llvm::Function* func = cUnit->intrinsic_helper->GetIntrinsicFunction(
-      greenland::IntrinsicHelper::ThrowVerificationError);
-  llvm::SmallVector<llvm::Value*, 2> args;
-  args.push_back(cUnit->irb->getInt32(info1));
-  args.push_back(cUnit->irb->getInt32(info2));
-  cUnit->irb->CreateCall(func, args);
-}
-
 void emitSuspendCheck(CompilationUnit* cUnit)
 {
   greenland::IntrinsicHelper::IntrinsicId id =
@@ -1359,29 +1349,13 @@
       }
       break;
 
-   case Instruction::THROW_VERIFICATION_ERROR:
-      convertThrowVerificationError(cUnit, vA, vB);
-      UNIMPLEMENTED(WARNING) << "Need dead code elimination pass"
-                             << " - disabling bitcode verification";
-      cUnit->enableDebug &= ~(1 << kDebugVerifyBitcode);
-      break;
-
     case Instruction::MOVE_RESULT_WIDE:
     case Instruction::MOVE_RESULT:
     case Instruction::MOVE_RESULT_OBJECT:
-#if defined(TARGET_ARM)
       /*
-       * Instruction rewriting on verification failure can eliminate
-       * the invoke that feeds this move0result.  It won't ever be reached,
-       * so we can ignore it.
-       * TODO: verify that previous instruction is THROW_VERIFICATION_ERROR,
-       * or better, add dead-code elimination.
+       * All move_results should have been folded into the preceeding invoke.
        */
-      UNIMPLEMENTED(WARNING) << "Need to verify previous inst was rewritten";
-#else
-      UNIMPLEMENTED(WARNING) << "need x86 move-result fusing";
-#endif
-
+      LOG(FATAL) << "Unexpected move_result";
       break;
 
     case Instruction::MONITOR_ENTER:
@@ -2632,16 +2606,6 @@
   genInstanceof(cUnit, typeIdx, rlDest, rlSrc);
 }
 
-void cvtThrowVerificationError(CompilationUnit* cUnit, llvm::CallInst* callInst)
-{
-  DCHECK_EQ(callInst->getNumArgOperands(), 2U);
-  llvm::ConstantInt* info1 =
-      llvm::dyn_cast<llvm::ConstantInt>(callInst->getArgOperand(0));
-  llvm::ConstantInt* info2 =
-      llvm::dyn_cast<llvm::ConstantInt>(callInst->getArgOperand(1));
-  genThrowVerificationError(cUnit, info1->getZExtValue(), info2->getZExtValue());
-}
-
 void cvtThrow(CompilationUnit* cUnit, llvm::CallInst* callInst)
 {
   DCHECK_EQ(callInst->getNumArgOperands(), 1U);
@@ -3103,9 +3067,6 @@
             case greenland::IntrinsicHelper::Throw:
               cvtThrow(cUnit, callInst);
               break;
-            case greenland::IntrinsicHelper::ThrowVerificationError:
-              cvtThrowVerificationError(cUnit, callInst);
-              break;
             case greenland::IntrinsicHelper::MonitorEnter:
               cvtMonitorEnterExit(cUnit, true /* isEnter */, callInst);
               break;
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index 5337726..b4e14ce 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -214,7 +214,6 @@
   RegLocation rlResult = badLoc;
   Instruction::Code opcode = mir->dalvikInsn.opcode;
   int optFlags = mir->optimizationFlags;
-  uint32_t vA = mir->dalvikInsn.vA;
   uint32_t vB = mir->dalvikInsn.vB;
   uint32_t vC = mir->dalvikInsn.vC;
 
@@ -386,10 +385,6 @@
       genThrow(cUnit, rlSrc[0]);
       break;
 
-    case Instruction::THROW_VERIFICATION_ERROR:
-      genThrowVerificationError(cUnit, vA, vB);
-      break;
-
     case Instruction::ARRAY_LENGTH:
       int lenOffset;
       lenOffset = Array::LengthOffset().Int32Value();