Interpreter entries and instrumentation as a listener.

Make the instrumentation responsible for whether we want method entry/exit
stubs, and allow it to use interpreter entry stubs when instruction by
instruction instrumentation is required. Improve deoptimization so more JDWP
test cases are passing.

Refactor exception debug posting, in particular improve reporting in the
interpreter. Improve class linker exception throwing so that broken dex files
are more likely to be reported. Fixes the performance issue Bug: 8410519.

Fix some error reporting lock level errors for the large object space. Make
fast object verification faster.

Add some debug mode robustness to finding dex PCs in GC maps.

Add printf attributes to JniAbortF and fix errors.

Expand run-test 044 to test return behaviors and fix issues with not throwing
appropriate exceptions for proxies.

Ensure causes are reported with a class linker NoClassDefFoundError and JNI
NoSuchFieldError.

Remove unused debugMe and updateDebuggerFromCode.

There's a minor sizing tweak to the arg array builder, and an extra reference
array check in the interpreter.

Some clean-up of trace code.

Fix reg type cache destructor if it is called after the reg type cache is
shutdown (as is the case in oatdump).

Change-Id: I6519c7b35df77f978d011999354c864f4918e8ce
diff --git a/src/debugger.h b/src/debugger.h
index ad01011..eb17695 100644
--- a/src/debugger.h
+++ b/src/debugger.h
@@ -39,6 +39,7 @@
 }  // namespace mirror
 struct AllocRecord;
 class Thread;
+class ThrowLocation;
 
 /*
  * Invoke-during-breakpoint support.
@@ -101,8 +102,8 @@
    * when the debugger attaches.
    */
   static void Connected();
-  static void GoActive() LOCKS_EXCLUDED(Locks::breakpoint_lock_);
-  static void Disconnected() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+  static void GoActive() LOCKS_EXCLUDED(Locks::breakpoint_lock_, Locks::mutator_lock_);
+  static void Disconnected() LOCKS_EXCLUDED(Locks::mutator_lock_);
   static void Disposed();
 
   // Returns true if we're actually debugging with a real debugger, false if it's
@@ -326,9 +327,8 @@
   static void PostLocationEvent(const mirror::AbstractMethod* method, int pcOffset,
                                 mirror::Object* thisPtr, int eventFlags)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
-  static void PostException(Thread* thread, JDWP::FrameId throw_frame_id,
-                            mirror::AbstractMethod* throw_method,
-                            uint32_t throw_dex_pc, mirror::AbstractMethod* catch_method,
+  static void PostException(Thread* thread, const ThrowLocation& throw_location,
+                            mirror::AbstractMethod* catch_method,
                             uint32_t catch_dex_pc, mirror::Throwable* exception)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void PostThreadStart(Thread* t)
@@ -338,7 +338,8 @@
   static void PostClassPrepare(mirror::Class* c)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
-  static void UpdateDebugger(int32_t dex_pc, Thread* self)
+  static void UpdateDebugger(Thread* thread, mirror::Object* this_object,
+                             const mirror::AbstractMethod* method, uint32_t new_dex_pc)
       LOCKS_EXCLUDED(Locks::breakpoint_lock_)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);