changeset 9998:8578909eeef4

8143219: AArch64 broken by 8141132: JEP 254: Compact Strings Reviewed-by: kvn
author aph
date Thu, 26 Nov 2015 10:38:33 +0000
parents eb08a4259f33
children 37ee45971b17
files src/cpu/aarch64/vm/aarch64.ad
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/aarch64.ad	Tue Dec 01 15:11:15 2015 -1000
+++ b/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);