mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-23 03:48:13 +00:00
8149080: AArch64: Recognise disjoint array copy in stub code
Detect array copy can use fwd copy by checking (dest-src) above_same (copy_size) Reviewed-by: aph
This commit is contained in:
parent
9ad1ef5b10
commit
663e1a5c6d
@ -792,6 +792,12 @@ class StubGenerator: public StubCodeGenerator {
|
||||
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(CodeEntryAlignment);
|
||||
__ bind(start);
|
||||
__ cmp(count, 8);
|
||||
@ -1160,8 +1166,11 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// caller can pass a 64-bit byte count here (from Unsafe.copyMemory)
|
||||
BLOCK_COMMENT("Entry:");
|
||||
}
|
||||
__ cmp(d, s);
|
||||
__ br(Assembler::LS, nooverlap_target);
|
||||
|
||||
// use fwd copy 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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user