--- old/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2019-03-14 17:07:37.754723684 +0000 +++ new/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2019-03-14 17:07:37.218718051 +0000 @@ -45,6 +45,9 @@ #ifdef COMPILER2 #include "opto/runtime.hpp" #endif +#if INCLUDE_ZGC +#include "gc/z/zThreadLocalData.hpp" +#endif #ifdef BUILTIN_SIM #include "../../../../../../simulator/simulator.hpp" @@ -579,6 +582,16 @@ // make sure object is 'reasonable' __ cbz(r0, exit); // if obj is NULL it is OK +#if INCLUDE_ZGC + if (UseZGC) { + // Check if mask is good. + // verifies that ZAddressBadMask & r0 == 0 + __ ldr(c_rarg3, Address(rthread, ZThreadLocalData::address_bad_mask_offset())); + __ andr(c_rarg2, r0, c_rarg3); + __ cbnz(c_rarg2, error); + } +#endif + // Check if the oop is in the right area of memory __ mov(c_rarg3, (intptr_t) Universe::verify_oop_mask()); __ andr(c_rarg2, r0, c_rarg3); @@ -1363,7 +1376,7 @@ } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, is_oop, d, count, saved_reg); + bs->arraycopy_prologue(_masm, decorators, is_oop, s, d, count, saved_reg); if (is_oop) { // save regs before copy_memory @@ -1437,7 +1450,7 @@ } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, is_oop, d, count, saved_regs); + bs->arraycopy_prologue(_masm, decorators, is_oop, s, d, count, saved_regs); if (is_oop) { // save regs before copy_memory @@ -1799,7 +1812,7 @@ } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, is_oop, to, count, wb_pre_saved_regs); + bs->arraycopy_prologue(_masm, decorators, is_oop, from, to, count, wb_pre_saved_regs); // save the original count __ mov(count_save, count);