ART: Arm64 optimizing compiler intrinsics

Implement most intrinsics for the optimizing compiler for Arm64.

Change-Id: Idb459be09f0524cb9aeab7a5c7fccb1c6b65a707
diff --git a/test/082-inline-execute/src/Main.java b/test/082-inline-execute/src/Main.java
index 5561a09..bf6c802 100644
--- a/test/082-inline-execute/src/Main.java
+++ b/test/082-inline-execute/src/Main.java
@@ -125,23 +125,25 @@
   // so we need to separate out the tests that are expected to throw exception
 
   public static void test_String_charAt() {
-    String testStr = "Now is the time";
+    String testStr = "Now is the time to test some stuff";
 
-    Assert.assertEquals('N', testStr.charAt(0));
-    Assert.assertEquals('o', testStr.charAt(1));
-    Assert.assertEquals(' ', testStr.charAt(10));
-    Assert.assertEquals('e', testStr.charAt(14));  // 14 = testStr.length()-1 as a constant.
-    Assert.assertEquals('N', test_String_charAt_inner(testStr, 0));
-    Assert.assertEquals('o', test_String_charAt_inner(testStr, 1));
-    Assert.assertEquals(' ', test_String_charAt_inner(testStr, 10));
-    Assert.assertEquals('e', test_String_charAt_inner(testStr, testStr.length()-1));
+    Assert.assertEquals(testStr.length() - 1, 33);  // 33 = testStr.length()-1 as a constant.
+    Assert.assertEquals('f', testStr.charAt(33));
 
-    test_String_charAtExc();
-    test_String_charAtExc2();
+    test_String_charAt(testStr, 'N', 'o', ' ', 'f');
+    test_String_charAt(testStr.substring(3,15), ' ', 'i', 'm', 'e');
+  }
+  public static void test_String_charAt(String testStr, char a, char b, char c, char d) {
+    Assert.assertEquals(a, testStr.charAt(0));
+    Assert.assertEquals(b, testStr.charAt(1));
+    Assert.assertEquals(c, testStr.charAt(10));
+    Assert.assertEquals(d, testStr.charAt(testStr.length()-1));
+
+    test_String_charAtExc(testStr);
+    test_String_charAtExc2(testStr);
   }
 
-  private static void test_String_charAtExc() {
-    String testStr = "Now is the time";
+  private static void test_String_charAtExc(String testStr) {
     try {
       testStr.charAt(-1);
       Assert.fail();
@@ -153,7 +155,12 @@
     } catch (StringIndexOutOfBoundsException expected) {
     }
     try {
-      testStr.charAt(15);  // 15 = "Now is the time".length()
+      if (testStr.length() == 34) {
+          testStr.charAt(34);  // 34 = "Now is the time to test some stuff".length()
+      } else {
+          Assert.assertEquals(testStr.length(), 12);  // 12 = " is the time".length()
+          testStr.charAt(12);
+      }
       Assert.fail();
     } catch (StringIndexOutOfBoundsException expected) {
     }
@@ -168,7 +175,13 @@
     } catch (StringIndexOutOfBoundsException expected) {
     }
     try {
-      test_String_charAt_inner(testStr, 15);  // 15 = "Now is the time".length()
+      if (testStr.length() == 34) {
+        // 34 = "Now is the time to test some stuff".length()
+        test_String_charAt_inner(testStr, 34);
+      } else {
+        Assert.assertEquals(testStr.length(), 12);  // 12 = " is the time".length()
+        test_String_charAt_inner(testStr, 12);
+      }
       Assert.fail();
     } catch (StringIndexOutOfBoundsException expected) {
     }
@@ -193,19 +206,27 @@
     return s.charAt(index);
   }
 
-  private static void test_String_charAtExc2() {
+  private static void test_String_charAtExc2(String testStr) {
     try {
-      test_String_charAtExc3();
+      test_String_charAtExc3(testStr);
+      Assert.fail();
+    } catch (StringIndexOutOfBoundsException expected) {
+    }
+    try {
+      test_String_charAtExc4(testStr);
       Assert.fail();
     } catch (StringIndexOutOfBoundsException expected) {
     }
   }
 
-  private static void test_String_charAtExc3() {
-    String testStr = "Now is the time";
+  private static void test_String_charAtExc3(String testStr) {
     Assert.assertEquals('N', testStr.charAt(-1));
   }
 
+  private static void test_String_charAtExc4(String testStr) {
+    Assert.assertEquals('N', testStr.charAt(100));
+  }
+
   static int start;
   private static int[] negIndex = { -100000 };
   public static void test_String_indexOf() {