src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
changeset 54266 7816d989bf21
parent 53719 3a56e823d843
child 54383 cdc3bb0983a6
equal deleted inserted replaced
54265:1b0163c877c0 54266:7816d989bf21
    71     }
    71     }
    72   }
    72   }
    73 }
    73 }
    74 
    74 
    75 void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
    75 void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
    76                                                        Register start, Register end, Register scratch, RegSet saved_regs) {
    76                                                        Register start, Register count, Register scratch, RegSet saved_regs) {
    77   if (is_oop) {
    77   if (is_oop) {
    78     __ push(saved_regs, sp);
    78     __ push(saved_regs, sp);
    79     // must compute element count unless barrier set interface is changed (other platforms supply count)
    79     assert_different_registers(start, count, scratch);
    80     assert_different_registers(start, end, scratch);
    80     assert_different_registers(c_rarg0, count);
    81     __ lea(scratch, Address(end, BytesPerHeapOop));
       
    82     __ sub(scratch, scratch, start);               // subtract start to get #bytes
       
    83     __ lsr(scratch, scratch, LogBytesPerHeapOop);  // convert to element count
       
    84     __ mov(c_rarg0, start);
    81     __ mov(c_rarg0, start);
    85     __ mov(c_rarg1, scratch);
    82     __ mov(c_rarg1, count);
    86     __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_array_post_entry), 2);
    83     __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_array_post_entry), 2);
    87     __ pop(saved_regs, sp);
    84     __ pop(saved_regs, sp);
    88   }
    85   }
    89 }
    86 }
    90 
    87