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/code_generator_x86.h b/compiler/optimizing/code_generator_x86.h
index ce25849..24993c3 100644
--- a/compiler/optimizing/code_generator_x86.h
+++ b/compiler/optimizing/code_generator_x86.h
@@ -434,13 +434,20 @@
   void Move32(Location destination, Location source);
   // Helper method to move a 64bits value between two locations.
   void Move64(Location destination, Location source);
-  // Helper method to move a value from an address to a register.
+  // Helper method to move a primitive value from an address to a register.
   void MoveFromMemory(DataType::Type dst_type,
                       Location dst,
                       Register src_base,
                       Register src_index = Register::kNoRegister,
                       ScaleFactor src_scale = TIMES_1,
                       int32_t src_disp = 0);
+  // Helper method to move a primitive value from a location to an address.
+  void MoveToMemory(DataType::Type src_type,
+                    Location src,
+                    Register dst_base,
+                    Register dst_index = Register::kNoRegister,
+                    ScaleFactor dst_scale = TIMES_1,
+                    int32_t dst_disp = 0);
 
   // Check if the desired_string_load_kind is supported. If it is, return it,
   // otherwise return a fall-back kind that should be used instead.