X86: Implement VarHandle.set() for fields.

This commit implements VarHandle set access mode for fields (both static
and instance). This also implied refactorizing the common parts of get
and set access modes (e.g. coordinate type checks).

Non-constant Int64 set value is not implemented.

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: I384c09e08f7a772fc7ec372b1ebb5f882ecc5586
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 3ad987e..bece0ac 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -4520,7 +4520,8 @@
                      // resolved_method is the ArtMethod object corresponding to the polymorphic
                      // method (e.g. VarHandle.get), resolved using the class linker. It is needed
                      // to pass intrinsic information to the HInvokePolymorphic node.
-                     ArtMethod* resolved_method)
+                     ArtMethod* resolved_method,
+                     dex::ProtoIndex proto_idx)
       : HInvoke(kInvokePolymorphic,
                 allocator,
                 number_of_arguments,
@@ -4529,14 +4530,18 @@
                 dex_pc,
                 dex_method_index,
                 resolved_method,
-                kPolymorphic) {
+                kPolymorphic),
+        proto_idx_(proto_idx) {
   }
 
   bool IsClonable() const override { return true; }
 
+  dex::ProtoIndex GetProtoIndex() { return proto_idx_; }
+
   DECLARE_INSTRUCTION(InvokePolymorphic);
 
  protected:
+  dex::ProtoIndex proto_idx_;
   DEFAULT_COPY_CONSTRUCTOR(InvokePolymorphic);
 };