< prev index next >

src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp

Print this page
rev 58065 : 8239081: Shenandoah: Consolidate C1 LRB and native barriers


  83   return BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value);
  84 }
  85 
  86 LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) {
  87   LIRGenerator* gen = access.gen();
  88   BasicType type = access.type();
  89 
  90   LIR_Opr result = gen->new_register(type);
  91   value.load_item();
  92   LIR_Opr value_opr = value.result();
  93 
  94   if (access.is_oop()) {
  95     value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
  96   }
  97 
  98   assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
  99   LIR_Opr tmp = gen->new_register(T_INT);
 100   __ xchg(access.resolved_addr(), value_opr, result, tmp);
 101 
 102   if (access.is_oop()) {
 103     result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0));
 104     LIR_Opr tmp = gen->new_register(type);
 105     __ move(result, tmp);
 106     result = tmp;
 107     if (ShenandoahSATBBarrier) {
 108       pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
 109                   result /* pre_val */);
 110     }
 111   }
 112 
 113   return result;
 114 }


  83   return BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value);
  84 }
  85 
  86 LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) {
  87   LIRGenerator* gen = access.gen();
  88   BasicType type = access.type();
  89 
  90   LIR_Opr result = gen->new_register(type);
  91   value.load_item();
  92   LIR_Opr value_opr = value.result();
  93 
  94   if (access.is_oop()) {
  95     value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
  96   }
  97 
  98   assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
  99   LIR_Opr tmp = gen->new_register(T_INT);
 100   __ xchg(access.resolved_addr(), value_opr, result, tmp);
 101 
 102   if (access.is_oop()) {
 103     result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0), false);
 104     LIR_Opr tmp = gen->new_register(type);
 105     __ move(result, tmp);
 106     result = tmp;
 107     if (ShenandoahSATBBarrier) {
 108       pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
 109                   result /* pre_val */);
 110     }
 111   }
 112 
 113   return result;
 114 }
< prev index next >