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

Tobias Hartmann tobias.hartmann at oracle.com
Thu Nov 19 15:08:28 UTC 2015

Hi Andrew,

thanks for catching this!

On 19.11.2015 12:56, 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.

Looks good.

> 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.

I think this check should be done in inline_string_indexOfI() because other intrinsics may also depend on it (see macroAssembler_x86.cpp). Same applies to the "substr count == 0" check. One could probably factor out the checks and use them for both inline_string_indexOf* methods.

I'm moving some more runtime checks from the Java code into the intrinsics (see JDK-8142303 which is currently out for review on hotspot-compiler-dev).

If you want, I can take care of these checks as well.


More information about the hotspot-dev mailing list