Support for unresolved types in new-instance during verification.

Also, ensure that classes that don't load are erroneous, warn early
about exceptions left on a thread by the verifier/compiler, factor out
slowpath checks for the compiler and fix the slowpath selector for
const-class.

This change causes more dex cache misses at runtime (more slowpath
execution). It also requires a "mm clean-oat".

Change-Id: I014b49ebdd7d8f7dd2e39cc0958fc0b708d58c4c
diff --git a/src/compiler.cc b/src/compiler.cc
index cbfd35c..ba61b4d 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -333,6 +333,9 @@
   // TODO: this fails if we have an abstract method defined in more than one input dex file.
   CHECK(compiled_invoke_stubs_.find(method) == compiled_invoke_stubs_.end()) << PrettyMethod(method);
   compiled_invoke_stubs_[method] = compiled_invoke_stub;
+
+  Thread* self = Thread::Current();
+  CHECK(!self->IsExceptionPending()) << PrettyMethod(method);
 }
 
 const CompiledMethod* Compiler::GetCompiledMethod(const Method* method) const {