< prev index next >

src/cpu/x86/vm/c1_LIRGenerator_x86.cpp

Print this page
rev 11560 : [backport] 8222766: Shenandoah: streamline post-LRB CAS barrier (x86)
Reviewed-by: rkennke


 775                         as_BasicType(type));
 776 #endif
 777   } else {
 778     a = new LIR_Address(obj.result(),
 779                         offset.result(),
 780                         LIR_Address::times_1,
 781                         0,
 782                         as_BasicType(type));
 783   }
 784   __ leal(LIR_OprFact::address(a), addr);
 785 
 786   if (type == objectType) {  // Write-barrier needed for Object fields.
 787     // Do the pre-write barrier, if any.
 788     pre_barrier(addr, LIR_OprFact::illegalOpr /* pre_val */,
 789                 true /* do_load */, false /* patch */, NULL);
 790   }
 791 
 792   LIR_Opr ill = LIR_OprFact::illegalOpr;  // for convenience
 793   if (type == objectType) {
 794 #if INCLUDE_ALL_GCS
 795     if (UseShenandoahGC) {
 796       __ cas_obj(addr, cmp.result(), val.result(), new_register(T_OBJECT), new_register(T_OBJECT));


 797     } else
 798 #endif
 799     {
 800     __ cas_obj(addr, cmp.result(), val.result(), ill, ill);
 801     }
 802   }
 803   else if (type == intType)
 804     __ cas_int(addr, cmp.result(), val.result(), ill, ill);
 805   else if (type == longType)
 806     __ cas_long(addr, cmp.result(), val.result(), ill, ill);
 807   else {
 808     ShouldNotReachHere();
 809   }
 810 
 811   // generate conditional move of boolean result
 812   LIR_Opr result = rlock_result(x);
 813   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
 814            result, as_BasicType(type));
 815   if (type == objectType) {   // Write-barrier needed for Object fields.
 816     // Seems to be precise




 775                         as_BasicType(type));
 776 #endif
 777   } else {
 778     a = new LIR_Address(obj.result(),
 779                         offset.result(),
 780                         LIR_Address::times_1,
 781                         0,
 782                         as_BasicType(type));
 783   }
 784   __ leal(LIR_OprFact::address(a), addr);
 785 
 786   if (type == objectType) {  // Write-barrier needed for Object fields.
 787     // Do the pre-write barrier, if any.
 788     pre_barrier(addr, LIR_OprFact::illegalOpr /* pre_val */,
 789                 true /* do_load */, false /* patch */, NULL);
 790   }
 791 
 792   LIR_Opr ill = LIR_OprFact::illegalOpr;  // for convenience
 793   if (type == objectType) {
 794 #if INCLUDE_ALL_GCS
 795     if (UseShenandoahGC && ShenandoahCASBarrier) {
 796       LIR_Opr result = rlock_result(x);
 797       __ cas_obj(addr, cmp.result(), val.result(), new_register(T_OBJECT), new_register(T_OBJECT), result);
 798       return;
 799     } else
 800 #endif
 801     {
 802     __ cas_obj(addr, cmp.result(), val.result(), ill, ill);
 803     }
 804   }
 805   else if (type == intType)
 806     __ cas_int(addr, cmp.result(), val.result(), ill, ill);
 807   else if (type == longType)
 808     __ cas_long(addr, cmp.result(), val.result(), ill, ill);
 809   else {
 810     ShouldNotReachHere();
 811   }
 812 
 813   // generate conditional move of boolean result
 814   LIR_Opr result = rlock_result(x);
 815   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
 816            result, as_BasicType(type));
 817   if (type == objectType) {   // Write-barrier needed for Object fields.
 818     // Seems to be precise


< prev index next >