< prev index next >

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

Print this page
@@ -1,7 +1,8 @@
  /*
   * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -39,12 +40,10 @@
    Register cmpval = _cmp_value->as_register();
    Register tmp1 = _tmp1->as_register();
    Register tmp2 = _tmp2->as_register();
    Register result = result_opr()->as_register();
  
-   ShenandoahBarrierSet::assembler()->iu_barrier(masm->masm(), newval, rscratch2);
- 
    if (UseCompressedOops) {
      __ encode_heap_oop(tmp1, cmpval);
      cmpval = tmp1;
      __ encode_heap_oop(tmp2, newval);
      newval = tmp2;

@@ -86,10 +85,14 @@
        LIR_Opr t2 = gen->new_register(T_OBJECT);
        LIR_Opr addr = access.resolved_addr()->as_address_ptr()->base();
        LIR_Opr result = gen->new_register(T_INT);
  
        __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result));
+ 
+       if (ShenandoahCardBarrier) {
+         post_barrier(access, access.resolved_addr(), new_value.result());
+       }
        return result;
      }
    }
    return BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value);
  }

@@ -100,14 +103,10 @@
  
    LIR_Opr result = gen->new_register(type);
    value.load_item();
    LIR_Opr value_opr = value.result();
  
-   if (access.is_oop()) {
-     value_opr = iu_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
-   }
- 
    assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
    LIR_Opr tmp = gen->new_register(T_INT);
    __ xchg(access.resolved_addr(), value_opr, result, tmp);
  
    if (access.is_oop()) {

@@ -117,9 +116,12 @@
      result = tmp;
      if (ShenandoahSATBBarrier) {
        pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr,
                    result /* pre_val */);
      }
+     if (ShenandoahCardBarrier) {
+       post_barrier(access, access.resolved_addr(), result);
+     }
    }
  
    return result;
  }
< prev index next >