< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp

Print this page




  93 
  94 LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) {
  95   LIRGenerator* gen = access.gen();
  96   BasicType type = access.type();
  97 
  98   LIR_Opr result = gen->new_register(type);
  99   value.load_item();
 100   LIR_Opr value_opr = value.result();
 101 
 102   if (access.is_oop()) {
 103     value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
 104   }
 105 
 106   // Because we want a 2-arg form of xchg and xadd
 107   __ move(value_opr, result);
 108 
 109   assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
 110   __ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr);
 111 
 112   if (access.is_oop()) {
 113     result = load_reference_barrier(access.gen(), result);
 114     LIR_Opr tmp = gen->new_register(type);
 115     __ move(result, tmp);
 116     result = tmp;
 117     if (ShenandoahSATBBarrier) {
 118       pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
 119                   result /* pre_val */);
 120     }
 121   }
 122 
 123   return result;
 124 }


  93 
  94 LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) {
  95   LIRGenerator* gen = access.gen();
  96   BasicType type = access.type();
  97 
  98   LIR_Opr result = gen->new_register(type);
  99   value.load_item();
 100   LIR_Opr value_opr = value.result();
 101 
 102   if (access.is_oop()) {
 103     value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
 104   }
 105 
 106   // Because we want a 2-arg form of xchg and xadd
 107   __ move(value_opr, result);
 108 
 109   assert(type == T_INT || type == T_OBJECT || type == T_ARRAY LP64_ONLY( || type == T_LONG ), "unexpected type");
 110   __ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr);
 111 
 112   if (access.is_oop()) {
 113     result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0));
 114     LIR_Opr tmp = gen->new_register(type);
 115     __ move(result, tmp);
 116     result = tmp;
 117     if (ShenandoahSATBBarrier) {
 118       pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
 119                   result /* pre_val */);
 120     }
 121   }
 122 
 123   return result;
 124 }
< prev index next >