Fix IC resolution DCHECK

We were incorrectly asserting that all inline-cache entries referring
to valid classes are resolvable. This is only true as long as the
profiles stay perfectly in sync with the framework code, which is not
likely to always be the case since we update profiles rather
infrequently. This simply loosens the dcheck to return null on
unresolvable methods when run in AOT mode.

Test: m droid
Bug: 168941430
Bug: 183514504
Change-Id: Id863b65ccead1a40643c4538df4f5215a18e39ad
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 04dcdb6..96cb605 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -761,7 +761,11 @@
     DCHECK(invoke_instruction->IsInvokeVirtual());
     resolved_method = klass->FindVirtualMethodForVirtual(resolved_method, pointer_size);
   }
-  DCHECK(resolved_method != nullptr);
+  // Even if the class exists we can still not have the function the
+  // inline-cache targets if the profile is from far enough in the past/future.
+  // We need to allow this since we don't update boot-profiles very often. This
+  // can occur in boot-profiles with inline-caches.
+  DCHECK(Runtime::Current()->IsAotCompiler() || resolved_method != nullptr);
   return resolved_method;
 }