ART: Refactor libarttest C++ code

Refactor some libarttest JNI functions into a common directory, so
they can be easily used by multiple tests without code duplication.
This is preparation for better deoptimization state testing.

Change-Id: I43f7340b699b26930aabfd665c707e0485b17fc8
diff --git a/test/088-monitor-verification/src/Main.java b/test/088-monitor-verification/src/Main.java
index 53b72e9..fc5755b 100644
--- a/test/088-monitor-verification/src/Main.java
+++ b/test/088-monitor-verification/src/Main.java
@@ -220,6 +220,11 @@
 
     // Smali testing code.
     private static void runSmaliTests() {
+        if (!hasOatFile() || runtimeIsSoftFail() || isCallerInterpreted()) {
+            // Skip test, this seems to be a non-compiled code test configuration.
+            return;
+        }
+
         runTest("OK", new Object[] { new Object(), new Object() }, null);
         runTest("TooDeep", new Object[] { new Object() }, null);
         runTest("NotStructuredOverUnlock", new Object[] { new Object() },
@@ -231,7 +236,6 @@
     }
 
     private static void runTest(String className, Object[] parameters, Class<?> excType) {
-        System.out.println(className);
         try {
             Class<?> c = Class.forName(className);
 
@@ -275,4 +279,7 @@
     // Helpers for the smali code.
     public static native void assertCallerIsInterpreted();
     public static native void assertCallerIsManaged();
+    public static native boolean hasOatFile();
+    public static native boolean runtimeIsSoftFail();
+    public static native boolean isCallerInterpreted();
 }