Ensure we don't AddLocalReference a bogus value when returning to native code from an upcall that threw.

Also add a few missing CHECKs.

Change-Id: Icf29506b258a2177b5e80c75cd2710761431ba4b
diff --git a/src/oat/runtime/arm/context_arm.cc b/src/oat/runtime/arm/context_arm.cc
index 28f1db9..50c386f 100644
--- a/src/oat/runtime/arm/context_arm.cc
+++ b/src/oat/runtime/arm/context_arm.cc
@@ -25,10 +25,10 @@
 #ifndef NDEBUG
   // Initialize registers with easy to spot debug values
   for (int i = 0; i < 16; i++) {
-    gprs_[i] = 0xEBAD6070+i;
+    gprs_[i] = kBadGprBase + i;
   }
   for (int i = 0; i < 32; i++) {
-    fprs_[i] = 0xEBAD8070+i;
+    fprs_[i] = kBadFprBase + i;
   }
 #endif
 }
@@ -61,6 +61,15 @@
   }
 }
 
+void ArmContext::SmashCallerSaves() {
+  gprs_[0] = 0; // This needs to be 0 because we want a null/zero return value.
+  gprs_[1] = kBadGprBase + 1;
+  gprs_[2] = kBadGprBase + 2;
+  gprs_[3] = kBadGprBase + 3;
+  gprs_[IP] = kBadGprBase + IP;
+  gprs_[LR] = kBadGprBase + LR;
+}
+
 extern "C" void art_do_long_jump(uint32_t*, uint32_t*);
 
 void ArmContext::DoLongJump() {