# HG changeset patch # Parent f9d267b67264ca3d4c27c85a490bc25e57f96c7e diff -r f9d267b67264 src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp Thu May 02 15:59:41 2019 -0400 @@ -37,7 +37,8 @@ public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, - Register addr, Register count, RegSet saved_regs) {} + Register src, Register dst, Register count, Register klass, + Label& L_exit, RegSet saved_regs) {} virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, Register start, Register end, Register tmp, RegSet saved_regs) {} virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, diff -r f9d267b67264 src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp --- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp Thu May 02 15:59:41 2019 -0400 @@ -29,10 +29,11 @@ #define __ masm-> void ModRefBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, - Register addr, Register count, RegSet saved_regs) { + Register src, Register dst, Register count, Register klass, + Label& L_exit, RegSet saved_regs) { if (is_oop) { - gen_write_ref_array_pre_barrier(masm, decorators, addr, count, saved_regs); + gen_write_ref_array_pre_barrier(masm, decorators, dst, count, saved_regs); } } diff -r f9d267b67264 src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp --- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp Thu May 02 15:59:41 2019 -0400 @@ -44,7 +44,8 @@ public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, - Register addr, Register count, RegSet saved_regs); + Register src, Register dst, Register count, Register klass, + Label& L_exit, RegSet saved_regs); virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, Register start, Register count, Register tmp, RegSet saved_regs); virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, diff -r f9d267b67264 src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp Thu May 02 15:59:41 2019 -0400 @@ -43,7 +43,8 @@ address ShenandoahBarrierSetAssembler::_shenandoah_lrb = NULL; void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, - Register addr, Register count, RegSet saved_regs) { + Register src, Register dst, Register count, Register klass, + Label& L_exit, RegSet saved_regs) { if (is_oop) { bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; if (ShenandoahSATBBarrier && !dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) { @@ -60,17 +61,17 @@ __ push(saved_regs, sp); if (count == c_rarg0) { - if (addr == c_rarg1) { + if (dst == c_rarg1) { // exactly backwards!! __ mov(rscratch1, c_rarg0); __ mov(c_rarg0, c_rarg1); __ mov(c_rarg1, rscratch1); } else { __ mov(c_rarg1, count); - __ mov(c_rarg0, addr); + __ mov(c_rarg0, dst); } } else { - __ mov(c_rarg0, addr); + __ mov(c_rarg0, dst); __ mov(c_rarg1, count); } if (UseCompressedOops) { diff -r f9d267b67264 src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp Thu May 02 15:59:41 2019 -0400 @@ -73,7 +73,8 @@ #endif virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, - Register addr, Register count, RegSet saved_regs); + Register src, Register dst, Register count, Register klass, + Label& L_exit, RegSet saved_regs); virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, Register start, Register count, Register tmp, RegSet saved_regs); virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, diff -r f9d267b67264 src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Thu May 02 15:59:41 2019 -0400 @@ -1362,8 +1362,9 @@ decorators |= ARRAYCOPY_ALIGNED; } + Label exit; 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, noreg, exit, saved_reg); if (is_oop) { // save regs before copy_memory @@ -1378,7 +1379,7 @@ } bs->arraycopy_epilogue(_masm, decorators, is_oop, d, count, rscratch1, RegSet()); - + __ bind(exit); __ leave(); __ mov(r0, zr); // return 0 __ ret(lr); @@ -1434,8 +1435,9 @@ decorators |= ARRAYCOPY_ALIGNED; } + Label exit; 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, noreg, exit, saved_regs); if (is_oop) { // save regs before copy_memory @@ -1448,6 +1450,7 @@ verify_oop_array(size, d, count, r16); } bs->arraycopy_epilogue(_masm, decorators, is_oop, d, count, rscratch1, RegSet()); + __ bind(exit); __ leave(); __ mov(r0, zr); // return 0 __ ret(lr); @@ -1794,12 +1797,13 @@ decorators |= IS_DEST_UNINITIALIZED; } - BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, is_oop, to, count, wb_pre_saved_regs); - // save the original count __ mov(count_save, count); + Label L_exit; + BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->arraycopy_prologue(_masm, decorators, is_oop, from, to, count, ckval, L_exit, wb_pre_saved_regs); + // Copy from low to high addresses __ mov(start_to, to); // Save destination array start address __ b(L_load_element); @@ -1833,6 +1837,7 @@ // Emit GC store barriers for the oops we have copied and report // their number to the caller. + __ bind(L_exit); __ subs(count, count_save, count); // K = partially copied oop count __ eon(count, count, zr); // report (-1^K) to caller __ br(Assembler::EQ, L_done_pop); diff -r f9d267b67264 src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp Thu May 02 15:59:41 2019 -0400 @@ -40,7 +40,7 @@ public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, - Register src, Register dst, Register count) {} + Register src, Register dst, Register count, Register klass, Label& L_exit) {} virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) {} diff -r f9d267b67264 src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp --- a/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp Thu May 02 15:59:41 2019 -0400 @@ -29,7 +29,7 @@ #define __ masm-> void ModRefBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, - Register src, Register dst, Register count) { + Register src, Register dst, Register count, Register klass, Label& L_exit) { bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0; bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0; bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops); diff -r f9d267b67264 src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.hpp --- a/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.hpp Thu May 02 15:59:41 2019 -0400 @@ -42,7 +42,7 @@ Address dst, Register val, Register tmp1, Register tmp2) = 0; public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, - Register src, Register dst, Register count); + Register src, Register dst, Register count, Register klass, Label& L_exit); virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count); diff -r f9d267b67264 src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp Thu May 02 15:59:41 2019 -0400 @@ -44,7 +44,7 @@ address ShenandoahBarrierSetAssembler::_shenandoah_lrb = NULL; void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, - Register src, Register dst, Register count) { + Register src, Register dst, Register count, Register klass, Label& L_exit) { bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0; bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0; diff -r f9d267b67264 src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp Thu May 02 15:59:41 2019 -0400 @@ -83,7 +83,7 @@ Register res, Address addr, Register oldval, Register newval, bool exchange, Register tmp1, Register tmp2); virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, - Register src, Register dst, Register count); + Register src, Register dst, Register count, Register klass, Label& L_exit); virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count); virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, diff -r f9d267b67264 src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp Thu May 02 15:59:41 2019 -0400 @@ -224,7 +224,9 @@ BasicType type, Register src, Register dst, - Register count) { + Register count, + Register klass, + Label& L_exit) { if (!ZBarrierSet::barrier_needed(decorators, type)) { // Barrier not needed return; diff -r f9d267b67264 src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp Thu May 02 15:59:41 2019 -0400 @@ -63,7 +63,9 @@ BasicType type, Register src, Register dst, - Register count); + Register count, + Register klass, + Label& L_exit); virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, diff -r f9d267b67264 src/hotspot/cpu/x86/stubGenerator_x86_64.cpp --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Thu May 02 11:06:18 2019 -0400 +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Thu May 02 15:59:41 2019 -0400 @@ -1868,7 +1868,7 @@ BasicType type = is_oop ? T_OBJECT : T_INT; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, type, from, to, count); + bs->arraycopy_prologue(_masm, decorators, type, from, to, count, noreg, L_exit); // 'from', 'to' and 'count' are now valid __ movptr(dword_count, count); @@ -1963,7 +1963,7 @@ BasicType type = is_oop ? T_OBJECT : T_INT; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); // no registers are destroyed by this call - bs->arraycopy_prologue(_masm, decorators, type, from, to, count); + bs->arraycopy_prologue(_masm, decorators, type, from, to, count, noreg, L_exit); assert_clean_int(count, rax); // Make sure 'count' is clean int. // 'from', 'to' and 'count' are now valid @@ -2066,7 +2066,7 @@ BasicType type = is_oop ? T_OBJECT : T_LONG; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, type, from, to, qword_count); + bs->arraycopy_prologue(_masm, decorators, type, from, to, qword_count, noreg, L_exit); // Copy from low to high addresses. Use 'to' as scratch. __ lea(end_from, Address(from, qword_count, Address::times_8, -8)); @@ -2159,7 +2159,7 @@ BasicType type = is_oop ? T_OBJECT : T_LONG; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, type, from, to, qword_count); + bs->arraycopy_prologue(_masm, decorators, type, from, to, qword_count, noreg, L_exit); __ jmp(L_copy_bytes); @@ -2350,7 +2350,7 @@ BasicType type = T_OBJECT; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); - bs->arraycopy_prologue(_masm, decorators, type, from, to, count); + bs->arraycopy_prologue(_masm, decorators, type, from, to, count, ckval, L_done); // Copy from low to high addresses, indexed from the end of each array. __ lea(end_from, end_from_addr);