hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
changeset 7713 1e06d2419258
parent 7397 5b173b4ca846
child 9176 42d9d1010f38
equal deleted inserted replaced
7712:cee30a0f4315 7713:1e06d2419258
   660   LIR_Opr t2 = FrameMap::G3_opr;  // temp for 64-bit value
   660   LIR_Opr t2 = FrameMap::G3_opr;  // temp for 64-bit value
   661   __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);
   661   __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);
   662 
   662 
   663   // generate conditional move of boolean result
   663   // generate conditional move of boolean result
   664   LIR_Opr result = rlock_result(x);
   664   LIR_Opr result = rlock_result(x);
   665   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result);
   665   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG);
   666 }
   666 }
   667 
   667 
   668 
   668 
   669 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
   669 void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
   670   assert(x->number_of_arguments() == 4, "wrong type");
   670   assert(x->number_of_arguments() == 4, "wrong type");
   697   else if (type == longType)
   697   else if (type == longType)
   698     __ cas_long(addr, cmp.result(), val.result(), t1, t2);
   698     __ cas_long(addr, cmp.result(), val.result(), t1, t2);
   699   else {
   699   else {
   700     ShouldNotReachHere();
   700     ShouldNotReachHere();
   701   }
   701   }
   702 
       
   703   // generate conditional move of boolean result
   702   // generate conditional move of boolean result
   704   LIR_Opr result = rlock_result(x);
   703   LIR_Opr result = rlock_result(x);
   705   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result);
   704   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
       
   705            result, as_BasicType(type));
   706   if (type == objectType) {  // Write-barrier needed for Object fields.
   706   if (type == objectType) {  // Write-barrier needed for Object fields.
   707     // Precise card mark since could either be object or array
   707     // Precise card mark since could either be object or array
   708     post_barrier(addr, val.result());
   708     post_barrier(addr, val.result());
   709   }
   709   }
   710 }
   710 }