x86 mterp: fix cherry-pick/merge, issue 3095771

Bug http://b/issue?id=3095771

Change
https://android-git.corp.google.com/g/#change,70700
was a cherry-pick/merge of
https://android-git.corp.google.com/g/#change,70388

It was not properly merged, and resulting in the register holding
the object head to be trashed (and subsequently broke GC).

Change-Id: Ic480104e3a643a5b744d36eb0aefaedd3e4f925c
diff --git a/vm/mterp/out/InterpAsm-x86.S b/vm/mterp/out/InterpAsm-x86.S
index 67df136..92b2d9d 100644
--- a/vm/mterp/out/InterpAsm-x86.S
+++ b/vm/mterp/out/InterpAsm-x86.S
@@ -6951,9 +6951,9 @@
     je        .LOP_APUT_OBJECT_skip_check
     SPILL(rPC)
     SPILL_TMP(%ecx)
+    movl      %eax,LOCAL0_OFFSET(%ebp)   # save copy of object head
     movl      offObject_clazz(%eax),%eax # eax<- arrayObj->clazz
     movl      offObject_clazz(rINST_FULL),%ecx # ecx<- obj->clazz
-    movl      %eax,LOCAL0_OFFSET(%ebp)  # save copy of object head
     movl      %eax,OUT_ARG1(%esp)
     movl      %ecx,OUT_ARG0(%esp)
     call      dvmCanPutArrayElement     # test object type vs. array type
diff --git a/vm/mterp/x86/OP_APUT_OBJECT.S b/vm/mterp/x86/OP_APUT_OBJECT.S
index 18eb9f4..3cd9e0d 100644
--- a/vm/mterp/x86/OP_APUT_OBJECT.S
+++ b/vm/mterp/x86/OP_APUT_OBJECT.S
@@ -29,9 +29,9 @@
     je        .L${opcode}_skip_check
     SPILL(rPC)
     SPILL_TMP(%ecx)
+    movl      %eax,LOCAL0_OFFSET(%ebp)   # save copy of object head
     movl      offObject_clazz(%eax),%eax # eax<- arrayObj->clazz
     movl      offObject_clazz(rINST_FULL),%ecx # ecx<- obj->clazz
-    movl      %eax,LOCAL0_OFFSET(%ebp)  # save copy of object head
     movl      %eax,OUT_ARG1(%esp)
     movl      %ecx,OUT_ARG0(%esp)
     call      dvmCanPutArrayElement     # test object type vs. array type