X86: Extend VarHandle.get() to work with instance fields.

Test: ART_HEAP_POISONING=true art/test.py --host --32 -r -t 712-varhandle-invocations
Test: ART_HEAP_POISONING=false art/test.py --host --32 -r -t 712-varhandle-invocations
Bug: 65872996
Change-Id: Ie64baf4d7d9bf3422c0e41b30d95ea903c2fabaa
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index f5cdf36..84d79e5 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1174,8 +1174,8 @@
   bool needs_ret_type_check =
       resolved_method->GetIntrinsic() == static_cast<uint32_t>(Intrinsics::kVarHandleGet) &&
       return_type == DataType::Type::kReference &&
-      // VarHandle.get() is only implemented for static fields for now.
-      number_of_arguments == 1u;
+      // VarHandle.get() is only implemented for fields now.
+      number_of_arguments < 3u;
   if (needs_ret_type_check) {
     ScopedObjectAccess soa(Thread::Current());
     ArtMethod* referrer = graph_->GetArtMethod();