Fixes to instrumentation and quick to interpreter entry.

- Interpreter entry was missing check that a static method is
  initialized.
- Fixed instrumentation stack unwinding to not pop off the handler
  frame only if it actually exists on the instrumentation stack.

Change-Id: I05a96ea7c0aea4dc6552da0edf485856cd004d85
diff --git a/runtime/thread.cc b/runtime/thread.cc
index d1e33b8..9b7d194 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1814,10 +1814,6 @@
       }
     } else {
       CHECK(!is_deoptimization_);
-      if (instrumentation_frames_to_pop_ > 0) {
-        // Don't pop the instrumentation frame of the catch handler.
-        instrumentation_frames_to_pop_--;
-      }
       if (kDebugExceptionDelivery) {
         const DexFile& dex_file = *catch_method->GetDeclaringClass()->GetDexCache()->GetDexFile();
         int line_number = dex_file.GetLineNumFromPC(catch_method, handler_dex_pc_);
@@ -1831,7 +1827,10 @@
     instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();
     for (size_t i = 0; i < instrumentation_frames_to_pop_; ++i) {
       // We pop the instrumentation stack here so as not to corrupt it during the stack walk.
-      instrumentation->PopMethodForUnwind(self_, is_deoptimization_);
+      if (i != instrumentation_frames_to_pop_ - 1 || self_->GetInstrumentationStack()->front().method_ != catch_method) {
+        // Don't pop the instrumentation frame of the catch handler.
+        instrumentation->PopMethodForUnwind(self_, is_deoptimization_);
+      }
     }
     if (!is_deoptimization_) {
       instrumentation->ExceptionCaughtEvent(self_, throw_location_, catch_method, handler_dex_pc_,