Add support for nested method verifiers

Can occur in the following scenario:
MethodVerifier::Verify -> MethodVerifier::GetStaticField ->
ResolveFieldJLS ->  ThrowNoSuchFieldError -> EnsureInitialized ->
VerifyClass

Also fixed another case where we can be requested to dump for ANR
while we are suspended in one of the AllowSuspension points.

Bug: 20140397

Change-Id: Ib17f6b98954caa5d1ea1c1dcde66091cc6d11c25
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index c813634..8c0321e 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -31,6 +31,7 @@
 
 class Instruction;
 struct ReferenceMap2Visitor;
+class Thread;
 
 namespace verifier {
 
@@ -738,6 +739,10 @@
   // FindLocksAtDexPC, resulting in deadlocks.
   const bool allow_thread_suspension_;
 
+  // Link, for the method verifier root linked list.
+  MethodVerifier* link_;
+
+  friend class art::Thread;
   DISALLOW_COPY_AND_ASSIGN(MethodVerifier);
 };
 std::ostream& operator<<(std::ostream& os, const MethodVerifier::FailureKind& rhs);