< prev index next >

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

Print this page

        

@@ -672,11 +672,11 @@
 LIR_Opr LIRGenerator::atomic_cmpxchg(BasicType type, LIR_Opr addr, LIRItem& cmp_value, LIRItem& new_value) {
   LIR_Opr ill = LIR_OprFact::illegalOpr;  // for convenience
   if (type == T_OBJECT || type == T_ARRAY) {
     cmp_value.load_item_force(FrameMap::rax_oop_opr);
     new_value.load_item();
-    __ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
+    __ cas_obj(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), new_register(T_OBJECT), new_register(T_OBJECT));
   } else if (type == T_INT) {
     cmp_value.load_item_force(FrameMap::rax_opr);
     new_value.load_item();
     __ cas_int(addr->as_address_ptr()->base(), cmp_value.result(), new_value.result(), ill, ill);
   } else if (type == T_LONG) {

@@ -697,11 +697,12 @@
   LIR_Opr result = new_register(type);
   value.load_item();
   // Because we want a 2-arg form of xchg and xadd
   __ move(value.result(), result);
   assert(type == T_INT || is_oop LP64_ONLY( || type == T_LONG ), "unexpected type");
-  __ xchg(addr, result, result, LIR_OprFact::illegalOpr);
+  LIR_Opr tmp = is_oop ? new_register(type) : LIR_OprFact::illegalOpr;
+  __ xchg(addr, result, result, tmp);
   return result;
 }
 
 LIR_Opr LIRGenerator::atomic_add(BasicType type, LIR_Opr addr, LIRItem& value) {
   LIR_Opr result = new_register(type);

@@ -1018,10 +1019,14 @@
         __ convert(Bytecodes::_i2l, index, tmp);
         index = tmp;
       }
 #endif
 
+      if (is_updateBytes) {
+        base_op = access_resolve_for_read(IN_HEAP | IS_NOT_NULL, base_op, NULL);
+      }
+
       LIR_Address* a = new LIR_Address(base_op,
                                        index,
                                        offset,
                                        T_BYTE);
       BasicTypeList signature(3);

@@ -1075,19 +1080,19 @@
   LIR_Opr result_aOffset = aOffset.result();
   if (result_aOffset->is_constant()) {
     constant_aOffset = result_aOffset->as_jlong();
     result_aOffset = LIR_OprFact::illegalOpr;
   }
-  LIR_Opr result_a = a.result();
+  LIR_Opr result_a = access_resolve_for_read(IN_HEAP, a.result(), NULL);
 
   long constant_bOffset = 0;
   LIR_Opr result_bOffset = bOffset.result();
   if (result_bOffset->is_constant()) {
     constant_bOffset = result_bOffset->as_jlong();
     result_bOffset = LIR_OprFact::illegalOpr;
   }
-  LIR_Opr result_b = b.result();
+  LIR_Opr result_b = access_resolve_for_read(IN_HEAP, b.result(), NULL);
 
 #ifndef _LP64
   result_a = new_register(T_INT);
   __ convert(Bytecodes::_l2i, a.result(), result_a);
   result_b = new_register(T_INT);
< prev index next >