RFR: Consolidate AArch64 assembly write-barriers

Roman Kennke rkennke at redhat.com
Mon Jul 9 18:04:37 UTC 2018


This extracts a small part from the 'Consolidate write-barriers' patch.

It makes the first bunch of gc-state-loads, checks and read-barriers
consistent in both versions of the write-barrier, and removes the
membar, which is no longer needed because we don't race with turning
evacuation off anymore.

# HG changeset patch
# User rkennke
# Date 1531159382 -7200
#      Mon Jul 09 20:03:02 2018 +0200
# Node ID 29c95612747e61784d73e1c9d1d4e11e4e942bdd
# Parent  789ca76047b0de1f9684ca0f0c56cd7af41a5d82
Consolidate AArch64 assembly write-barriers

diff --git
a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
---
a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
+++
b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
@@ -274,11 +274,16 @@

   Address gc_state(rthread,
in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
   __ ldrb(rscratch1, gc_state);
-  __ membar(Assembler::LoadLoad);

-  // Now check if evacuation is in progress.
-  read_barrier_not_null(masm, dst);
+  // Check for heap stability
+  __ cbz(rscratch1, done);

+  // Heap is unstable, need to perform the read-barrier even if WB is
inactive
+  if (ShenandoahWriteBarrierRB) {
+    __ ldr(dst, Address(dst, BrooksPointer::byte_offset()));
+  }
+
+  // Check for evacuation-in-progress and jump to WB slow-path if needed
   __ mov(rscratch2, ShenandoahHeap::EVACUATION |
ShenandoahHeap::TRAVERSAL);
   __ tst(rscratch1, rscratch2);
   __ br(Assembler::EQ, done);





More information about the shenandoah-dev mailing list