RFR: 8149733: AArch64: refactor char_array_equals/byte_array_equals/string_equals
hui.shi at linaro.org
Fri Feb 19 12:13:28 UTC 2016
Could some one help review this patch? This patch mainly aims to
refactoring similar code on AArch64 for string equals/ char array equals
and byte array equals.
1. Add new method MacroAssembler::generic_arrays_equals method, its
implementation combines string_equals and char/byte_array_equals.
For array length >= 8 bytes, compare main body and tail bytes in 8 bytes
wide. Same with current string equals' implementation. This eliminates tail
branches and loads and improve performance on short length compare.
For array length < 8 bytes, compare in test-ld-cmp sequence. It out
performs loop copy in string_equals.
2. Remove unnecessary lea address computation (mov array pointer to last
word) in string_equals.
3. Remove unnecessary tmp register for string_equals.
JTreg doesn’t show regression and performance also doesn't degradate with
different length combination. Small char/byte equals improves in most
tests. There is one slow run with new implementation, because last several
chars are different in test case. Original char array equals can find the
difference with first test-ld-cmp check, test-ld-cmp sequence might be
faster than entire unaligned 8 byte compare in some corner cases. Test
different chars in middle of string, performance is close for both
Test case: http://cr.openjdk.java.net/~hshi/8149733/TestArrayEqual.java
Test result: http://cr.openjdk.java.net/~hshi/8149733/ArrayEqual.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev