changeset 24677:db68f26d4f1b

8044090: C1: Old value instead of new one is passed to post-barrier in UnsafeGetAndSetObject Summary: Pass correct value to post-barrier in UnsafeGetAndSetObject Reviewed-by: roland, vlivanov
author iveresov
date Wed, 28 May 2014 07:59:23 -1000
parents 1db7e277df87
children 9bb217f7f313
files hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Wed May 28 14:42:00 2014 +0400
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Wed May 28 07:59:23 2014 -1000
@@ -1221,10 +1221,8 @@
   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
   LIR_Opr offset = off.result();
 
-  if (data != dst) {
-    __ move(data, dst);
-    data = dst;
-  }
+  // Because we want a 2-arg form of xchg
+  __ move(data, dst);
 
   assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type");
   LIR_Address* addr;
@@ -1254,7 +1252,7 @@
     pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */,
                 true /* do_load */, false /* patch */, NULL);
   }
-  __ xchg(LIR_OprFact::address(addr), data, dst, tmp);
+  __ xchg(LIR_OprFact::address(addr), dst, dst, tmp);
   if (is_obj) {
     // Seems to be a precise address
     post_barrier(ptr, data);