Avoid compile time rewriting of dex code by verifier.

Compile time rewriting of dex code leads to dead code that is causing
issues with the LLVM compiler. Make instantiation and incompatible class
change errors be detected in slow path field and invoke logic so its
safe for the compile time verification just to softly fail the effected
classes.

This change places incompatible class change logic into the class
linkers ResolveMethod and consequently changes a number of APIs.

Change-Id: Ifb25f09accea348d15180f6ff041e38dfe0d536e
diff --git a/src/oat_writer.h b/src/oat_writer.h
index 60a79a2..200d695 100644
--- a/src/oat_writer.h
+++ b/src/oat_writer.h
@@ -96,8 +96,8 @@
                              const DexFile::ClassDef& class_def)
       SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
   size_t InitOatCodeMethod(size_t offset, size_t oat_class_index, size_t class_def_index,
-                           size_t class_def_method_index, bool is_native, bool is_static,
-                           bool is_direct, uint32_t method_idx, const DexFile*)
+                           size_t class_def_method_index, bool is_native, InvokeType type,
+                           uint32_t method_idx, const DexFile*)
       SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
 
   bool Write(File* file);