< prev index next >
test/compiler/c2/Test6910605_2.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
*** 25,45 ****
/**
* @test
* @bug 6910605
* @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
*
! * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000 Test
! *
*/
/*
* Added InlineSmallCode=2000 to guaranty inlining of StringBuilder::append() to allow scalar replace StringBuilder object.
*
* original test: gc/gctests/StringGC
*/
! public class Test {
private final String toAdd = "0123456789abcdef";
private int maxLength;
private static final int numberOfThreads = 8;
private class StringAdder extends Thread {
--- 25,48 ----
/**
* @test
* @bug 6910605
* @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
*
! * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot
! * -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000
! * compiler.c2.Test6910605_2
*/
+ package compiler.c2;
+
/*
* Added InlineSmallCode=2000 to guaranty inlining of StringBuilder::append() to allow scalar replace StringBuilder object.
*
* original test: gc/gctests/StringGC
*/
! public class Test6910605_2 {
private final String toAdd = "0123456789abcdef";
private int maxLength;
private static final int numberOfThreads = 8;
private class StringAdder extends Thread {
*** 46,64 ****
private String s;
public void test() {
s = s + toAdd;
}
public void run() {
do {
test();
} while (s.length() < maxLength);
}
}
public void test() throws InterruptedException {
! maxLength = toAdd.length() * 15000/ numberOfThreads;
StringAdder[] sa = new StringAdder[numberOfThreads];
for (int i = 0; i < numberOfThreads; i++) {
sa[i] = new StringAdder();
sa[i].start();
}
--- 49,68 ----
private String s;
public void test() {
s = s + toAdd;
}
+
public void run() {
do {
test();
} while (s.length() < maxLength);
}
}
public void test() throws InterruptedException {
! maxLength = toAdd.length() * 15000 / numberOfThreads;
StringAdder[] sa = new StringAdder[numberOfThreads];
for (int i = 0; i < numberOfThreads; i++) {
sa[i] = new StringAdder();
sa[i].start();
}
*** 66,74 ****
sa[i].join();
}
}
public static void main(String[] args) throws InterruptedException {
! Test t = new Test();
t.test();
}
}
--- 70,78 ----
sa[i].join();
}
}
public static void main(String[] args) throws InterruptedException {
! Test6910605_2 t = new Test6910605_2();
t.test();
}
}
< prev index next >