RFR(s): AAch64: Adding byte array equal support

Hui Shi hui.shi at linaro.org
Sat Feb 6 12:24:03 UTC 2016

Hi All,

Would someone help review this patch for adding byte array equal support on

bug: https://bugs.openjdk.java.net/browse/JDK-8149100
webrev: http://cr.openjdk.java.net/~hshi/8149100/webrev/

For http://cr.openjdk.java.net/~hshi/8149100/testcase/ArrayEqual.java,
debug build run will failed with “bad AD file” assertion on aarch64.
 # To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/matcher.cpp:1605
# A fatal error has been detected by the Java Runtime Environment:
# Internal Error
pid=8501, tid=8746
# assert(false) failed: bad AD file

Debugg shows AryEqNode’s enconding is StrIntrinsicNode::LL, which is not
supported on aarch64 now.
1605 assert( false, "bad AD file" );
(gdb) p ((AryEqNode*)n)->encoding()
$1 = StrIntrinsicNode::LL

Fix is adding support for StrIntrinsicNode::LL encoding array equal
operation, as Latin String compare might become important in JDK9 with new
1. Adding MacroAssembler::byte_arrays_equals to support byte array equals
2. Add new array_equalsB rule when AryEq enconding is StrIntrinsicNode::LL.

shows newly generated assembly.

Relase build will invoke Array.equals method before this patch, with this
patch, significant improvment on ArrayEqual case.
time -p openjdk-9-internal.base/bin/java  ArrayEqual
real 54.98
user 55.13

time -p openjdk-9-internal.byteEquals/bin/java  ArrayEqual
real 28.59
user 28.62
sys 0.14

Following code sequence can be replaced with tbz (when tst has constant
exactly two’s n times value), these code sequence exist in other
places(MacroAssembler::char_arrays_equals, interpreter, etc). I would like
clean all together in another separate changeset.
    tst(cnt1, 0b10);
    br(EQ, TAIL01);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160206/94651634/attachment.html>

More information about the hotspot-compiler-dev mailing list