src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp
changeset 49470 a273b521a559
parent 49455 848864ed9b17
child 49480 d7df2dd501ce
equal deleted inserted replaced
49469:1708db7f94c6 49470:a273b521a559
  2775     // pass length argument on SP[0]
  2775     // pass length argument on SP[0]
  2776     __ str(length, Address(SP, -2*wordSize, pre_indexed));  // 2 words for a proper stack alignment
  2776     __ str(length, Address(SP, -2*wordSize, pre_indexed));  // 2 words for a proper stack alignment
  2777 #endif // AARCH64
  2777 #endif // AARCH64
  2778 
  2778 
  2779     address copyfunc_addr = StubRoutines::generic_arraycopy();
  2779     address copyfunc_addr = StubRoutines::generic_arraycopy();
  2780     if (copyfunc_addr == NULL) { // Use C version if stub was not generated
  2780     assert(copyfunc_addr != NULL, "generic arraycopy stub required");
  2781       __ call(CAST_FROM_FN_PTR(address, Runtime1::arraycopy));
       
  2782     } else {
       
  2783 #ifndef PRODUCT
  2781 #ifndef PRODUCT
  2784       if (PrintC1Statistics) {
  2782     if (PrintC1Statistics) {
  2785         __ inc_counter((address)&Runtime1::_generic_arraycopystub_cnt, tmp, tmp2);
  2783       __ inc_counter((address)&Runtime1::_generic_arraycopystub_cnt, tmp, tmp2);
  2786       }
  2784     }
  2787 #endif // !PRODUCT
  2785 #endif // !PRODUCT
  2788       // the stub is in the code cache so close enough
  2786     // the stub is in the code cache so close enough
  2789       __ call(copyfunc_addr, relocInfo::runtime_call_type);
  2787     __ call(copyfunc_addr, relocInfo::runtime_call_type);
  2790     }
       
  2791 
  2788 
  2792 #ifdef AARCH64
  2789 #ifdef AARCH64
  2793     __ raw_pop(length, ZR);
  2790     __ raw_pop(length, ZR);
  2794 #else
  2791 #else
  2795     __ add(SP, SP, 2*wordSize);
  2792     __ add(SP, SP, 2*wordSize);
  2796 #endif // AARCH64
  2793 #endif // AARCH64
  2797 
  2794 
  2798     __ cbz_32(R0, *stub->continuation());
  2795     __ cbz_32(R0, *stub->continuation());
  2799 
  2796 
  2800     if (copyfunc_addr != NULL) {
  2797     __ mvn_32(tmp, R0);
  2801       __ mvn_32(tmp, R0);
  2798     restore_from_reserved_area(R0, R1, R2, R3);  // load saved arguments in slow case only
  2802       restore_from_reserved_area(R0, R1, R2, R3);  // load saved arguments in slow case only
  2799     __ sub_32(length, length, tmp);
  2803       __ sub_32(length, length, tmp);
  2800     __ add_32(src_pos, src_pos, tmp);
  2804       __ add_32(src_pos, src_pos, tmp);
  2801     __ add_32(dst_pos, dst_pos, tmp);
  2805       __ add_32(dst_pos, dst_pos, tmp);
       
  2806     } else {
       
  2807       restore_from_reserved_area(R0, R1, R2, R3);  // load saved arguments in slow case only
       
  2808     }
       
  2809 
  2802 
  2810     __ b(*stub->entry());
  2803     __ b(*stub->entry());
  2811 
  2804 
  2812     __ bind(*stub->continuation());
  2805     __ bind(*stub->continuation());
  2813     return;
  2806     return;