< prev index next >

test/compiler/escapeAnalysis/Test6689060.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke

@@ -23,37 +23,42 @@
 
 /*
  * @test
  * @bug 6689060
  * @summary Escape Analysis does not work with Compressed Oops
- * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test
+ *
+ * @run main/othervm -Xbatch -XX:+AggressiveOpts
+ *      -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6689060::dummy
+ *      compiler.escapeAnalysis.Test6689060
  */
 
+package compiler.escapeAnalysis;
+
 import java.lang.reflect.Array;
 
-class Point {
+public class Test6689060 {
+    static class Point {
   int x;
   int y;
   Point next;
   int ax[];
   int ay[];
   Point pax[];
   Point pay[];
+
   public Point getNext() {
     return next;
   }
-}
+    }
 
-public class Test {
-
   void dummy() {
     // Empty method to verify correctness of DebugInfo.
     // Use -XX:CompileCommand=exclude,Test.dummy
   }
 
   int ival(int i) {
-    return i*2;
+        return i * 2;
   }
 
   int test80(int y, int l, int i) {
     Point p = new Point();
     p.ax = new int[2];

@@ -85,11 +90,11 @@
     return p1.y;
   }
 
   int test43(int y) {
     Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = ival(3);
     } else {
       p1.x = ival(5);
     }
     dummy();

@@ -99,21 +104,21 @@
 
   int test42(int y) {
     Point p1 = new Point();
     p1.x = 3;
     for (int i = 0; i < y; i++) {
-      if ( (i & 1) == 1 ) {
+            if ((i & 1) == 1) {
         p1.x += 4;
       }
     }
     p1.y = 3 * y + p1.x;
     return p1.y;
   }
 
   int test40(int y) {
     Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
     } else {
       p1.x = 5;
     }
     p1.y = 3 * p1.x + y;

@@ -120,11 +125,11 @@
     return p1.y;
   }
 
   int test41(int y) {
     Point p1 = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x += 4;
     } else {
       p1.x += 5;
     }
     p1.y = 3 * p1.x + y;

@@ -211,11 +216,11 @@
     return p.x * p.y;
   }
 
   int test1(int y) {
     Point p = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p = new Point(); // Kill previous
     }
     int x = 3;
     p.x = x;
     p.y = 3 * x + y;

@@ -245,11 +250,11 @@
   }
 
   int test4(int y) {
     Point p1 = new Point();
     Point p2 = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p2.x = 4;
     } else {
       p1.x = 5;
       p2.x = 6;

@@ -260,11 +265,11 @@
     return p1.y * p2.y;
   }
 
   int test5(int y, Point p1) {
     Point p2 = new Point();
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p2.x = 4;
     } else {
       p1.x = 5;
       p2.x = 6;

@@ -277,11 +282,11 @@
 
   int test6(int y) {
     Point p1 = new Point();
     Point p2 = new Point();
     p1.next = p2;
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p1.getNext().x = 4;
     } else {
       p1.x = 5;
       p1.getNext().x = 6;

@@ -293,11 +298,11 @@
   }
 
   int test7(int y, Point p1) {
     Point p2 = new Point();
     p1.next = p2;
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p1.getNext().x = 4;
     } else {
       p1.x = 5;
       p1.getNext().x = 6;

@@ -334,17 +339,15 @@
   }
 
   int test10(int y, int l, int i, Class cls) {
     Point p = new Point();
     try {
-      p.pax = (Point[])Array.newInstance(cls, l);
-      p.pax[i] = (Point)cls.newInstance();
-    }
-    catch(java.lang.InstantiationException ex) {
+            p.pax = (Point[]) Array.newInstance(cls, l);
+            p.pax[i] = (Point) cls.newInstance();
+        } catch (java.lang.InstantiationException ex) {
       return 0;
-    }
-    catch(java.lang.IllegalAccessException ex) {
+        } catch (java.lang.IllegalAccessException ex) {
       return 0;
     }
     p.pax[i].x = 3;
     p.pax[i].y = 3 * p.pax[i].x + y;
     dummy();

@@ -353,11 +356,11 @@
 
   int test11(int y) {
     Point p1 = new Point();
     Point p2 = new Point();
     p1.next = p2;
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p1.next.x = 4;
     } else {
       p1.x = 5;
       p1.next.x = 6;

@@ -369,11 +372,11 @@
   }
 
   int test12(int y) {
     Point p1 = new Point();
     p1.next = p1;
-    if ( (y & 1) == 1 ) {
+        if ((y & 1) == 1) {
       p1.x = 3;
       p1.next.x = 4;
     } else {
       p1.x = 5;
       p1.next.x = 6;

@@ -384,16 +387,16 @@
     return p1.y * p1.next.y;
   }
 
 
   public static void main(String args[]) {
-    Test tsr    = new Test();
+        Test6689060 tsr = new Test6689060();
     Point p     = new Point();
     Point ptmp  = p;
     Class cls   = Point.class;
     int y = 0;
-    for (int i=0; i<10000; i++) {
+        for (int i = 0; i < 10000; i++) {
       ptmp.next = tsr.test00(1);
       ptmp.next = tsr.test01(1);
       ptmp.next = tsr.test02(1);
       ptmp.next = tsr.test03(1);
       ptmp.next = tsr.test04(1);

@@ -421,11 +424,11 @@
       y = tsr.test9(y, 1, 0);
       y = tsr.test10(y, 1, 0, cls);
       y = tsr.test11(y);
       y = tsr.test12(y);
     }
-    for (int i=0; i<10000; i++) {
+        for (int i = 0; i < 10000; i++) {
       ptmp.next = tsr.test00(1);
       ptmp.next = tsr.test01(1);
       ptmp.next = tsr.test02(1);
       ptmp.next = tsr.test03(1);
       ptmp.next = tsr.test04(1);

@@ -453,11 +456,11 @@
       y = tsr.test9(y, 1, 0);
       y = tsr.test10(y, 1, 0, cls);
       y = tsr.test11(y);
       y = tsr.test12(y);
     }
-    for (int i=0; i<10000; i++) {
+        for (int i = 0; i < 10000; i++) {
       ptmp.next = tsr.test00(1);
       ptmp.next = tsr.test01(1);
       ptmp.next = tsr.test02(1);
       ptmp.next = tsr.test03(1);
       ptmp.next = tsr.test04(1);
< prev index next >