8143219: AArch64 broken by 8141132: JEP 254: Compact Strings
authoraph
Thu, 26 Nov 2015 10:38:33 +0000
changeset 34509 5b125fa28ea9
parent 34508 838d37db4223
child 34510 f3f38d88223e
8143219: AArch64 broken by 8141132: JEP 254: Compact Strings Reviewed-by: kvn
hotspot/src/cpu/aarch64/vm/aarch64.ad
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad	Tue Dec 01 15:11:15 2015 -1000
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad	Thu Nov 26 10:38:33 2015 +0000
@@ -14299,6 +14299,9 @@
 
   format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   # KILL $tmp1" %}
   ins_encode %{
+    // Count is in 8-bit bytes; non-Compact chars are 16 bits.
+    __ asrw($cnt1$$Register, $cnt1$$Register, 1);
+    __ asrw($cnt2$$Register, $cnt2$$Register, 1);
     __ string_compare($str1$$Register, $str2$$Register,
                       $cnt1$$Register, $cnt2$$Register, $result$$Register,
                       $tmp1$$Register);
@@ -14355,6 +14358,8 @@
 
   format %{ "String Equals $str1,$str2,$cnt -> $result    // KILL $tmp" %}
   ins_encode %{
+    // Count is in 8-bit bytes; non-Compact chars are 16 bits.
+    __ asrw($cnt$$Register, $cnt$$Register, 1);
     __ string_equals($str1$$Register, $str2$$Register,
                       $cnt$$Register, $result$$Register,
                       $tmp$$Register);