--- old/src/cpu/aarch64/vm/aarch64.ad 2016-10-21 17:18:56.455296370 +0200 +++ new/src/cpu/aarch64/vm/aarch64.ad 2016-10-21 17:18:56.316298962 +0200 @@ -9350,15 +9350,11 @@ Register s = $src$$Register; Register d = $dst$$Register; assert(d == r0, "result in r0"); - Address evacuation_in_progress = Address(rthread, in_bytes(JavaThread::evacuation_in_progress_offset())); __ block_comment("Shenandoah write barrier {"); + // We need that first read barrier in order to trigger a SEGV/NPE on incoming NULL. + // Also, it brings s into d in preparation for the call to shenandoah_write_barrier(). __ ldr(d, Address(s, BrooksPointer::byte_offset())); - __ ldrb(rscratch1, evacuation_in_progress); - __ membar(Assembler::LoadLoad); - __ ldr(d, Address(s, BrooksPointer::byte_offset())); - __ cbzw(rscratch1, done); - __ far_call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::aarch64::shenandoah_wb())), NULL, lr); - __ bind(done); + __ shenandoah_write_barrier(d); __ block_comment("} Shenandoah write barrier"); %} ins_pipe(pipe_slow);