RFR: 8143219: AArch64 broken by 8141132: JEP 254: Compact Strings

Edward Nevill edward.nevill at gmail.com
Thu Nov 19 15:33:14 UTC 2015

On Thu, 2015-11-19 at 11:56 +0000, Andrew Haley wrote:
> http://cr.openjdk.java.net/~aph/8143219/
> Two things happened, one simple and one not-so-simple.
> Firstly, the string comparators now take a byte count (because it's a
> byte array now) rather than a char count.
> Secondly, string_indexOf needs to have a guard to make sure that
> substr.count <= string.count.  This is guaranteed by
> LibraryCallKit::inline_string_indexOf but not by
> LibraryCallKit::inline_string_indexOfI.  This is a subtle change, and
> was quite tricky to figure out.  I have fixed it here in the AArch64
> back end.
> It would be nice to have the preconditions for the intrinsics
> commented somewhere, so that a porter could know what they should do
> and what they should expect.

Two things

1) Is it really the case that string_compare takes the inputs as a byte count but returns the result as a char count which AFAICS is what this does. It would be nice to know the post-conditions as well.

2) For efficiency the asr cnt, #1 instructions could be folded into the implementations of string_compare and string_equals. I think this could be deferred until we add back end support for CompactStrings - it is more important to get aarch64 tree working again.

All the best,

More information about the hotspot-dev mailing list