< prev index next >
test/compiler/escapeAnalysis/Test6689060.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
*** 23,59 ****
/*
* @test
* @bug 6689060
* @summary Escape Analysis does not work with Compressed Oops
! * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test
*/
import java.lang.reflect.Array;
! 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;
}
int test80(int y, int l, int i) {
Point p = new Point();
p.ax = new int[2];
--- 23,64 ----
/*
* @test
* @bug 6689060
* @summary Escape Analysis does not work with Compressed Oops
! *
! * @run main/othervm -Xbatch -XX:+AggressiveOpts
! * -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6689060::dummy
! * compiler.escapeAnalysis.Test6689060
*/
+ package compiler.escapeAnalysis;
+
import java.lang.reflect.Array;
! 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;
}
! }
void dummy() {
// Empty method to verify correctness of DebugInfo.
// Use -XX:CompileCommand=exclude,Test.dummy
}
int ival(int i) {
! return i * 2;
}
int test80(int y, int l, int i) {
Point p = new Point();
p.ax = new int[2];
*** 85,95 ****
return p1.y;
}
int test43(int y) {
Point p1 = new Point();
! if ( (y & 1) == 1 ) {
p1.x = ival(3);
} else {
p1.x = ival(5);
}
dummy();
--- 90,100 ----
return p1.y;
}
int test43(int y) {
Point p1 = new Point();
! if ((y & 1) == 1) {
p1.x = ival(3);
} else {
p1.x = ival(5);
}
dummy();
*** 99,119 ****
int test42(int y) {
Point p1 = new Point();
p1.x = 3;
for (int i = 0; i < y; i++) {
! 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 ) {
p1.x = 3;
} else {
p1.x = 5;
}
p1.y = 3 * p1.x + y;
--- 104,124 ----
int test42(int y) {
Point p1 = new Point();
p1.x = 3;
for (int i = 0; i < y; i++) {
! 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) {
p1.x = 3;
} else {
p1.x = 5;
}
p1.y = 3 * p1.x + y;
*** 120,130 ****
return p1.y;
}
int test41(int y) {
Point p1 = new Point();
! if ( (y & 1) == 1 ) {
p1.x += 4;
} else {
p1.x += 5;
}
p1.y = 3 * p1.x + y;
--- 125,135 ----
return p1.y;
}
int test41(int y) {
Point p1 = new Point();
! if ((y & 1) == 1) {
p1.x += 4;
} else {
p1.x += 5;
}
p1.y = 3 * p1.x + y;
*** 211,221 ****
return p.x * p.y;
}
int test1(int y) {
Point p = new Point();
! if ( (y & 1) == 1 ) {
p = new Point(); // Kill previous
}
int x = 3;
p.x = x;
p.y = 3 * x + y;
--- 216,226 ----
return p.x * p.y;
}
int test1(int y) {
Point p = new Point();
! if ((y & 1) == 1) {
p = new Point(); // Kill previous
}
int x = 3;
p.x = x;
p.y = 3 * x + y;
*** 245,255 ****
}
int test4(int y) {
Point p1 = new Point();
Point p2 = new Point();
! if ( (y & 1) == 1 ) {
p1.x = 3;
p2.x = 4;
} else {
p1.x = 5;
p2.x = 6;
--- 250,260 ----
}
int test4(int y) {
Point p1 = new Point();
Point p2 = new Point();
! if ((y & 1) == 1) {
p1.x = 3;
p2.x = 4;
} else {
p1.x = 5;
p2.x = 6;
*** 260,270 ****
return p1.y * p2.y;
}
int test5(int y, Point p1) {
Point p2 = new Point();
! if ( (y & 1) == 1 ) {
p1.x = 3;
p2.x = 4;
} else {
p1.x = 5;
p2.x = 6;
--- 265,275 ----
return p1.y * p2.y;
}
int test5(int y, Point p1) {
Point p2 = new Point();
! if ((y & 1) == 1) {
p1.x = 3;
p2.x = 4;
} else {
p1.x = 5;
p2.x = 6;
*** 277,287 ****
int test6(int y) {
Point p1 = new Point();
Point p2 = new Point();
p1.next = p2;
! if ( (y & 1) == 1 ) {
p1.x = 3;
p1.getNext().x = 4;
} else {
p1.x = 5;
p1.getNext().x = 6;
--- 282,292 ----
int test6(int y) {
Point p1 = new Point();
Point p2 = new Point();
p1.next = p2;
! if ((y & 1) == 1) {
p1.x = 3;
p1.getNext().x = 4;
} else {
p1.x = 5;
p1.getNext().x = 6;
*** 293,303 ****
}
int test7(int y, Point p1) {
Point p2 = new Point();
p1.next = p2;
! if ( (y & 1) == 1 ) {
p1.x = 3;
p1.getNext().x = 4;
} else {
p1.x = 5;
p1.getNext().x = 6;
--- 298,308 ----
}
int test7(int y, Point p1) {
Point p2 = new Point();
p1.next = p2;
! if ((y & 1) == 1) {
p1.x = 3;
p1.getNext().x = 4;
} else {
p1.x = 5;
p1.getNext().x = 6;
*** 334,350 ****
}
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) {
return 0;
! }
! catch(java.lang.IllegalAccessException ex) {
return 0;
}
p.pax[i].x = 3;
p.pax[i].y = 3 * p.pax[i].x + y;
dummy();
--- 339,353 ----
}
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) {
return 0;
! } catch (java.lang.IllegalAccessException ex) {
return 0;
}
p.pax[i].x = 3;
p.pax[i].y = 3 * p.pax[i].x + y;
dummy();
*** 353,363 ****
int test11(int y) {
Point p1 = new Point();
Point p2 = new Point();
p1.next = p2;
! if ( (y & 1) == 1 ) {
p1.x = 3;
p1.next.x = 4;
} else {
p1.x = 5;
p1.next.x = 6;
--- 356,366 ----
int test11(int y) {
Point p1 = new Point();
Point p2 = new Point();
p1.next = p2;
! if ((y & 1) == 1) {
p1.x = 3;
p1.next.x = 4;
} else {
p1.x = 5;
p1.next.x = 6;
*** 369,379 ****
}
int test12(int y) {
Point p1 = new Point();
p1.next = p1;
! if ( (y & 1) == 1 ) {
p1.x = 3;
p1.next.x = 4;
} else {
p1.x = 5;
p1.next.x = 6;
--- 372,382 ----
}
int test12(int y) {
Point p1 = new Point();
p1.next = p1;
! if ((y & 1) == 1) {
p1.x = 3;
p1.next.x = 4;
} else {
p1.x = 5;
p1.next.x = 6;
*** 384,399 ****
return p1.y * p1.next.y;
}
public static void main(String args[]) {
! Test tsr = new Test();
Point p = new Point();
Point ptmp = p;
Class cls = Point.class;
int y = 0;
! 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);
--- 387,402 ----
return p1.y * p1.next.y;
}
public static void main(String args[]) {
! 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++) {
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,431 ****
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++) {
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);
--- 424,434 ----
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++) {
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,463 ****
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++) {
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);
--- 456,466 ----
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++) {
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 >