Do not build intrinsic graph for signature polymorphic methods.

The InstructionBuilder cannot build HInvokePolymorphic for
an intrinsic graph. It would be rather useless to allow this
as signature polymorphic method intrinsics always need the
slow-path for unhandled cases, and we would therefore reject
the compiled code anyway. Instead, prevent the construction
of the intrinsic graph for signature polymorphic methods.

Test: testrunner.py --host --optimizing -t 712-varhandle-invocations
Bug: 65872996
Change-Id: Id82f1f282383dbd45d6db2bd2a96d838b685d7ed
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index a3630af..d264bee 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -452,6 +452,10 @@
 void HInstructionBuilder::BuildIntrinsic(ArtMethod* method) {
   DCHECK(!code_item_accessor_.HasCodeItem());
   DCHECK(method->IsIntrinsic());
+  if (kIsDebugBuild) {
+    ScopedObjectAccess soa(Thread::Current());
+    CHECK(!method->IsSignaturePolymorphic());
+  }
 
   locals_for_.resize(
       graph_->GetBlocks().size(),