Support for deoptimization needed for debugging.

The deoptimization code is untested, and some sanity checks in the
instrumentation are disabled because they need debugging.

Change-Id: I1b60a65a60bddc9b107ad4659da097b55ce901c3
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index e425ee8..bff9f37 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -546,11 +546,11 @@
 }
 
 static JValue Execute(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
-                      ShadowFrame& shadow_frame) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+                      ShadowFrame& shadow_frame, JValue result_register)
+    SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
   const uint16_t* insns = code_item->insns_;
   const Instruction* inst = Instruction::At(insns + shadow_frame.GetDexPC());
   bool entry = (inst->GetDexPc(insns) == 0);
-  JValue result_register;
   while (true) {
     CheckSuspend(self);
     uint32_t dex_pc = inst->GetDexPc(insns);
@@ -1846,7 +1846,7 @@
     }
   }
   if (LIKELY(!method->IsNative())) {
-    JValue r = Execute(self, mh, code_item, *shadow_frame.get());
+    JValue r = Execute(self, mh, code_item, *shadow_frame.get(), JValue());
     if (result != NULL) {
       *result = r;
     }
@@ -1862,5 +1862,12 @@
   self->PopShadowFrame();
 }
 
+JValue EnterInterpreterFromDeoptimize(Thread* self, ShadowFrame& shadow_frame, JValue ret_val)
+    SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+  MethodHelper mh(shadow_frame.GetMethod());
+  const DexFile::CodeItem* code_item = mh.GetCodeItem();
+  return Execute(self, mh, code_item, shadow_frame, ret_val);
+}
+
 }  // namespace interpreter
 }  // namespace art