Inline caches: be more robust in the presence of framework change.

What used to be a class could be changed into an interface. Test for
that case as well.

Test: test.py
Bug: 194817322
Change-Id: I4c225640b45c529d440faa701ed29f978b7cbd28
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 2ecdd10..6331a70 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -720,6 +720,13 @@
     if (!resolved_method->GetDeclaringClass()->IsAssignableFrom(klass.Get())) {
       return nullptr;
     }
+
+    // Also check whether the type in the inline cache is an interface or an
+    // abstract class. We only expect concrete classes in inline caches, so this
+    // means the class was changed.
+    if (klass->IsAbstract() || klass->IsInterface()) {
+      return nullptr;
+    }
   }
 
   if (invoke_instruction->IsInvokeInterface()) {