< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.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.

*** 44,13 ***
    assert(newval != noreg, "new val must be register");
    assert(cmpval != newval, "cmp and new values must be in different registers");
    assert(cmpval != addr, "cmp and addr must be in different registers");
    assert(newval != addr, "new value and addr must be in different registers");
  
-   // Apply IU barrier to newval.
-   ShenandoahBarrierSet::assembler()->iu_barrier(masm->masm(), newval, tmp1);
- 
  #ifdef _LP64
    if (UseCompressedOops) {
      __ encode_heap_oop(cmpval);
      __ mov(rscratch1, newval);
      __ encode_heap_oop(rscratch1);
--- 45,10 ---

*** 85,10 ***
--- 83,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);
  }

*** 99,14 ***
  
    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());
-   }
- 
    // Because we want a 2-arg form of xchg and xadd
    __ move(value_opr, result);
  
    assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
    __ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr);
--- 101,10 ---

*** 118,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 >