RFR(s): AArch64: 8149080: Recoginize disjoint array copy in stub code

Andrew Haley aph at redhat.com
Tue Feb 9 13:54:25 UTC 2016

On 05/02/16 12:47, Hui Shi wrote:

> Would some one help review this changeset?  This improves performance for
> codes like string builder and concat on aarch64.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8149080
> webrev: http://cr.openjdk.java.net/~hshi/8149080/webrev/

After some discussion with Edward Nevill, I am persuaded to accept
this patch.  While I'm not really happy that the backwards copy is so
much slower than forwards, this patch is very low risk.  I have
checked the boundary conditions of

  (unsigned long)(d - s) >= (unsigned long)size

and I'm convinced it's the correct test in this case.

However, the comment

    // no overlap when (d-s) above_equal (count*size)

is wrong.  If d < s, unsigned(d-s) is >= (count*size) but the two
strings may still overlap.  This doesn't affect correctness in this
case, because the forwards copy is the right one to use.  Having said
that, if someone changes nooverlap_target so that it is incorrect when
copying overlapping arrays we'll have a problem.



More information about the hotspot-compiler-dev mailing list