8224187: Refactor arraycopy_prologue to allow ZGC read barriers on arraycopy
Reviewed-by: eosterlund
--- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp Wed May 22 06:29:08 2019 -0400
@@ -37,7 +37,7 @@
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, 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,
--- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp Wed May 22 06:29:08 2019 -0400
@@ -29,10 +29,10 @@
#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, 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);
}
}
--- a/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp Wed May 22 06:29:08 2019 -0400
@@ -44,7 +44,7 @@
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, 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,
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp Wed May 22 06:29:08 2019 -0400
@@ -44,7 +44,7 @@
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, 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()) {
@@ -61,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) {
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp Wed May 22 06:29:08 2019 -0400
@@ -73,7 +73,7 @@
#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, 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,
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Wed May 22 06:13:53 2019 -0400
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Wed May 22 06:29:08 2019 -0400
@@ -1364,7 +1364,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
@@ -1436,7 +1436,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
@@ -1796,7 +1796,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);