hotspot/test/compiler/stable/TestStableChar.java
changeset 36508 5f9eee6b383b
parent 35099 982950884444
child 36616 5172e3dd60f2
--- a/hotspot/test/compiler/stable/TestStableChar.java	Tue Mar 15 13:48:21 2016 -0700
+++ b/hotspot/test/compiler/stable/TestStableChar.java	Thu Mar 17 19:04:01 2016 +0000
@@ -26,65 +26,38 @@
 /*
  * @test TestStableChar
  * @summary tests on stable fields and arrays
- * @library /testlibrary /test/lib
- * @build TestStableChar StableConfiguration sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main ClassFileInstaller
- *           java/lang/invoke/StableConfiguration
- *           java/lang/invoke/TestStableChar
- *           java/lang/invoke/TestStableChar$CharStable
- *           java/lang/invoke/TestStableChar$StaticCharStable
- *           java/lang/invoke/TestStableChar$VolatileCharStable
- *           java/lang/invoke/TestStableChar$CharArrayDim1
- *           java/lang/invoke/TestStableChar$CharArrayDim2
- *           java/lang/invoke/TestStableChar$CharArrayDim3
- *           java/lang/invoke/TestStableChar$CharArrayDim4
- *           java/lang/invoke/TestStableChar$ObjectArrayLowerDim0
- *           java/lang/invoke/TestStableChar$ObjectArrayLowerDim1
- *           java/lang/invoke/TestStableChar$NestedStableField
- *           java/lang/invoke/TestStableChar$NestedStableField$A
- *           java/lang/invoke/TestStableChar$NestedStableField1
- *           java/lang/invoke/TestStableChar$NestedStableField1$A
- *           java/lang/invoke/TestStableChar$NestedStableField2
- *           java/lang/invoke/TestStableChar$NestedStableField2$A
- *           java/lang/invoke/TestStableChar$NestedStableField3
- *           java/lang/invoke/TestStableChar$NestedStableField3$A
- *           java/lang/invoke/TestStableChar$DefaultValue
- *           java/lang/invoke/TestStableChar$DefaultStaticValue
- *           java/lang/invoke/TestStableChar$ObjectArrayLowerDim2
+ * @library /testlibrary /test/lib /
+ * @modules java.base/jdk.internal.vm.annotation
+ * @build sun.hotspot.WhiteBox
+ * @build compiler.stable.TestStableChar
  *
- * @run main/othervm -Xbootclasspath/a:.
- *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
- *                   -XX:-TieredCompilation
- *                   -XX:+FoldStableValues
- *                   -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
- *                   java.lang.invoke.TestStableChar
- * @run main/othervm -Xbootclasspath/a:.
- *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
- *                   -XX:-TieredCompilation
- *                   -XX:-FoldStableValues
- *                   -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
- *                   java.lang.invoke.TestStableChar
+ * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+ *                         -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ *                         -XX:-TieredCompilation
+ *                         -XX:+FoldStableValues
+ *                         compiler.stable.TestStableChar
+ * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+ *                         -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ *                         -XX:-TieredCompilation
+ *                         -XX:+FoldStableValues
+ *                         compiler.stable.TestStableChar
  *
- * @run main/othervm -Xbootclasspath/a:.
- *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
- *                   -XX:+TieredCompilation -XX:TieredStopAtLevel=1
- *                   -XX:+FoldStableValues
- *                   -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
- *                   java.lang.invoke.TestStableChar
- * @run main/othervm -Xbootclasspath/a:.
- *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
- *                   -XX:+TieredCompilation -XX:TieredStopAtLevel=1
- *                   -XX:-FoldStableValues
- *                   -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
- *                   java.lang.invoke.TestStableChar
- *
+ * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+ *                         -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ *                         -XX:-TieredCompilation
+ *                         -XX:+FoldStableValues
+ *                         compiler.stable.TestStableChar
+ * @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
+ *                         -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
+ *                         -XX:-TieredCompilation
+ *                         -XX:+FoldStableValues
+ *                         compiler.stable.TestStableChar
  */
-package java.lang.invoke;
 
-import jdk.internal.vm.annotation.Stable;
+package compiler.stable;
 
 import java.lang.reflect.InvocationTargetException;
+import jdk.internal.vm.annotation.Stable;
 
 public class TestStableChar {
     static final boolean isStableEnabled    = StableConfiguration.isStableEnabled;
@@ -127,7 +100,7 @@
         public static final DefaultValue c = new DefaultValue();
         public static char get() { return c.v; }
         public static void test() throws Exception {
-                       char val1 = get();
+            char val1 = get();
             c.v = 'a'; char val2 = get();
             assertEquals(val1, 0);
             assertEquals(val2, 'a');
@@ -157,7 +130,7 @@
         public static final DefaultStaticValue c = new DefaultStaticValue();
         public static char get() { return c.v; }
         public static void test() throws Exception {
-                       char val1 = get();
+            char val1 = get();
             c.v = 'a'; char val2 = get();
             assertEquals(val1, 0);
             assertEquals(val2, 'a');
@@ -207,24 +180,24 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1]; c.v[0] = 'a'; char val1 = get();
-                                   c.v[0] = 'b'; char val2 = get();
+                c.v[0] = 'b'; char val2 = get();
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isServerWithStable ? 'a' : 'b'));
 
                 c.v = new char[1]; c.v[0] = 'c'; char val3 = get();
                 assertEquals(val3, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'c'));
+                        : 'c'));
             }
 
             {
                 c.v = new char[20]; c.v[10] = 'a'; char val1 = get1();
-                                    c.v[10] = 'b'; char val2 = get1();
+                c.v[10] = 'b'; char val2 = get1();
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isServerWithStable ? 'a' : 'b'));
 
                 c.v = new char[20]; c.v[10] = 'c'; char val3 = get1();
                 assertEquals(val3, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'c'));
+                        : 'c'));
             }
 
             {
@@ -247,17 +220,17 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1][1]; c.v[0][0] = 'a'; char val1 = get();
-                                      c.v[0][0] = 'b'; char val2 = get();
+                c.v[0][0] = 'b'; char val2 = get();
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isServerWithStable ? 'a' : 'b'));
 
                 c.v = new char[1][1]; c.v[0][0] = 'c'; char val3 = get();
                 assertEquals(val3, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'c'));
+                        : 'c'));
 
                 c.v[0] = new char[1]; c.v[0][0] = 'd'; char val4 = get();
                 assertEquals(val4, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'd'));
+                        : 'd'));
             }
 
             {
@@ -287,21 +260,21 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1][1][1]; c.v[0][0][0] = 'a'; char val1 = get();
-                                         c.v[0][0][0] = 'b'; char val2 = get();
+                c.v[0][0][0] = 'b'; char val2 = get();
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isServerWithStable ? 'a' : 'b'));
 
                 c.v = new char[1][1][1]; c.v[0][0][0] = 'c'; char val3 = get();
                 assertEquals(val3, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'c'));
+                        : 'c'));
 
                 c.v[0] = new char[1][1]; c.v[0][0][0] = 'd'; char val4 = get();
                 assertEquals(val4, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'd'));
+                        : 'd'));
 
                 c.v[0][0] = new char[1]; c.v[0][0][0] = 'e'; char val5 = get();
                 assertEquals(val5, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'e'));
+                        : 'e'));
             }
 
             {
@@ -338,25 +311,25 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1][1][1][1]; c.v[0][0][0][0] = 'a'; char val1 = get();
-                                            c.v[0][0][0][0] = 'b'; char val2 = get();
+                c.v[0][0][0][0] = 'b'; char val2 = get();
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isServerWithStable ? 'a' : 'b'));
 
                 c.v = new char[1][1][1][1]; c.v[0][0][0][0] = 'c'; char val3 = get();
                 assertEquals(val3, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'c'));
+                        : 'c'));
 
                 c.v[0] = new char[1][1][1]; c.v[0][0][0][0] = 'd'; char val4 = get();
                 assertEquals(val4, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'd'));
+                        : 'd'));
 
                 c.v[0][0] = new char[1][1]; c.v[0][0][0][0] = 'e'; char val5 = get();
                 assertEquals(val5, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'e'));
+                        : 'e'));
 
                 c.v[0][0][0] = new char[1]; c.v[0][0][0][0] = 'f'; char val6 = get();
                 assertEquals(val6, (isStableEnabled ? (isServerWithStable ? 'a' : 'b')
-                                                    : 'f'));
+                        : 'f'));
             }
 
             {
@@ -397,7 +370,7 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1]; ((char[])c.v)[0] = 'a'; char val1 = get();
-                                   ((char[])c.v)[0] = 'b'; char val2 = get();
+                ((char[])c.v)[0] = 'b'; char val2 = get();
 
                 assertEquals(val1, 'a');
                 assertEquals(val2, 'b');
@@ -424,7 +397,7 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1][1]; ((char[][])c.v)[0][0] = 'a'; char val1 = get();
-                                      ((char[][])c.v)[0][0] = 'b'; char val2 = get();
+                ((char[][])c.v)[0][0] = 'b'; char val2 = get();
 
                 assertEquals(val1, 'a');
                 assertEquals(val2, 'b');
@@ -432,7 +405,7 @@
 
             {
                 c.v = new char[1][1]; c.v[0] = new char[0]; char[] val1 = get1();
-                                      c.v[0] = new char[0]; char[] val2 = get1();
+                c.v[0] = new char[0]; char[] val2 = get1();
 
                 assertTrue((isServerWithStable ? (val1 == val2) : (val1 != val2)));
             }
@@ -460,7 +433,7 @@
         public static void test() throws Exception {
             {
                 c.v = new char[1][1][1]; ((char[][][])c.v)[0][0][0] = 'a';  char val1 = get();
-                                         ((char[][][])c.v)[0][0][0] = 'b'; char val2 = get();
+                ((char[][][])c.v)[0][0][0] = 'b'; char val2 = get();
 
                 assertEquals(val1, 'a');
                 assertEquals(val2, 'b');
@@ -468,14 +441,14 @@
 
             {
                 c.v = new char[1][1][1]; c.v[0][0] = new char[0]; char[] val1 = get1();
-                                         c.v[0][0] = new char[0]; char[] val2 = get1();
+                c.v[0][0] = new char[0]; char[] val2 = get1();
 
                 assertTrue((isServerWithStable ? (val1 == val2) : (val1 != val2)));
             }
 
             {
                 c.v = new char[1][1][1]; c.v[0] = new char[0][0]; char[][] val1 = get2();
-                                         c.v[0] = new char[0][0]; char[][] val2 = get2();
+                c.v[0] = new char[0][0]; char[][] val2 = get2();
 
                 assertTrue((isServerWithStable ? (val1 == val2) : (val1 != val2)));
             }
@@ -505,7 +478,7 @@
         public static void test() throws Exception {
             {
                 c.v = new A(); c.v.a = 'a'; A val1 = get();
-                               c.v.a = 'b'; A val2 = get();
+                c.v.a = 'b'; A val2 = get();
 
                 assertEquals(val1.a, 'b');
                 assertEquals(val2.a, 'b');
@@ -513,7 +486,7 @@
 
             {
                 c.v = new A(); c.v.a = 'a'; char val1 = get1();
-                               c.v.a = 'b'; char val2 = get1();
+                c.v.a = 'b'; char val2 = get1();
                 c.v = new A(); c.v.a = 'c'; char val3 = get1();
 
                 assertEquals(val1, 'a');
@@ -539,8 +512,8 @@
         public static void test() throws Exception {
             {
                 c.v = new A(); c.v.next = new A(); c.v.next.next  = c.v;
-                               c.v.a = 'a'; c.v.next.a = 'a'; A val1 = get();
-                               c.v.a = 'b'; c.v.next.a = 'b'; A val2 = get();
+                c.v.a = 'a'; c.v.next.a = 'a'; A val1 = get();
+                c.v.a = 'b'; c.v.next.a = 'b'; A val2 = get();
 
                 assertEquals(val1.a, 'b');
                 assertEquals(val2.a, 'b');
@@ -548,10 +521,10 @@
 
             {
                 c.v = new A(); c.v.next = c.v;
-                               c.v.a = 'a'; char val1 = get1();
-                               c.v.a = 'b'; char val2 = get1();
+                c.v.a = 'a'; char val1 = get1();
+                c.v.a = 'b'; char val2 = get1();
                 c.v = new A(); c.v.next = c.v;
-                               c.v.a = 'c'; char val3 = get1();
+                c.v.a = 'c'; char val3 = get1();
 
                 assertEquals(val1, 'a');
                 assertEquals(val2, (isStableEnabled ? 'a' : 'b'));
@@ -577,8 +550,8 @@
         public static void test() throws Exception {
             {
                 c.v = new A(); c.v.left = c.v.right = c.v;
-                               c.v.a = 'a'; char val1 = get(); char val2 = get1();
-                               c.v.a = 'b'; char val3 = get(); char val4 = get1();
+                c.v.a = 'a'; char val1 = get(); char val2 = get1();
+                c.v.a = 'b'; char val3 = get(); char val4 = get1();
 
                 assertEquals(val1, 'a');
                 assertEquals(val3, (isStableEnabled ? 'a' : 'b'));
@@ -608,8 +581,8 @@
             {
                 A elem = new A();
                 c.v = new A[] { elem, elem }; c.v[0].left = c.v[0].right = c.v;
-                               elem.a = 'a'; char val1 = get(); char val2 = get1();
-                               elem.a = 'b'; char val3 = get(); char val4 = get1();
+                elem.a = 'a'; char val1 = get(); char val2 = get1();
+                elem.a = 'b'; char val3 = get(); char val4 = get1();
 
                 assertEquals(val1, 'a');
                 assertEquals(val3, (isServerWithStable ? 'a' : 'b'));