< prev index next >
src/cpu/aarch64/vm/stubGenerator_aarch64.cpp
Print this page
rev 10076 : 8149080: AArch64: Recoginize disjoint array copy in stub code
Summary: Detect array copy not overlapping by checking (dest-src) above_same (copy_size)
Reviewed-by: duke
*** 789,798 ****
--- 789,804 ----
assert_different_registers(rscratch1, t0, t1, t2, t3, t4, t5, t6, t7);
assert_different_registers(s, d, count, rscratch1);
Label again, large, small;
+ const char *stub_name;
+ if (direction == copy_forwards)
+ stub_name = "foward_copy_longs";
+ else
+ stub_name = "backward_copy_longs";
+ StubCodeMark mark(this, "StubRoutines", stub_name);
__ align(6);
__ bind(start);
__ cmp(count, 8);
__ br(Assembler::LO, small);
if (direction == copy_forwards) {
*** 1149,1160 ****
if (entry != NULL) {
*entry = __ pc();
// caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
BLOCK_COMMENT("Entry:");
}
! __ cmp(d, s);
! __ br(Assembler::LS, nooverlap_target);
if (is_oop) {
__ push(RegSet::of(d, count), sp);
// no registers are destroyed by this call
gen_write_ref_array_pre_barrier(d, count, dest_uninitialized);
--- 1155,1169 ----
if (entry != NULL) {
*entry = __ pc();
// caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
BLOCK_COMMENT("Entry:");
}
!
! // no overlap when (d-s) above_equal (count*size)
! __ sub(rscratch1, d, s);
! __ cmp(rscratch1, count, Assembler::LSL, exact_log2(size));
! __ br(Assembler::HS, nooverlap_target);
if (is_oop) {
__ push(RegSet::of(d, count), sp);
// no registers are destroyed by this call
gen_write_ref_array_pre_barrier(d, count, dest_uninitialized);
< prev index next >