< prev index next >
test/hotspot/jtreg/compiler/runtime/TestFloatsOnStackDeopt.java
Print this page
*** 37,46 ****
--- 37,47 ----
private static final int ARRLEN = 97;
private static final int ITERS1 = 100;
private static final int ITERS2 = 40000;
private static final float VALUE = 15.f;
public static String dummyString = "long long string";
+ static volatile boolean pleaseStop = false;
static void run_loop_with_safepoint(float[] a0, float b) {
// Non-counted loop with safepoint.
for (long l = 0; l < ITERS2; l++) {
// Counted and vectorized loop.
*** 52,64 ****
static int test() {
// thread provokes frequent GC - together with +DeoptimizeALot and safepoint it forces executed function deoptimization
Thread th = new Thread() {
public void run() {
! while(true) {
synchronized(this) { try { wait(1); } catch (Exception ex) {} }
! dummyString += dummyString;
if (dummyString.length() > 1024*1024) { dummyString = "long long string"; }
}
}
};
th.start();
--- 53,65 ----
static int test() {
// thread provokes frequent GC - together with +DeoptimizeALot and safepoint it forces executed function deoptimization
Thread th = new Thread() {
public void run() {
! while (!pleaseStop) {
synchronized(this) { try { wait(1); } catch (Exception ex) {} }
! dummyString = new StringBuilder(dummyString).append(dummyString).toString();
if (dummyString.length() > 1024*1024) { dummyString = "long long string"; }
}
}
};
th.start();
*** 75,85 ****
x0[i] = 0.f; // Reset
}
if (errn > 0) break;
}
! th.stop();
return errn;
}
public static void main(String args[]) {
int errn = test();
--- 76,91 ----
x0[i] = 0.f; // Reset
}
if (errn > 0) break;
}
! pleaseStop = true;
! try {
! th.join();
! } catch (InterruptedException e) {
! throw new Error("InterruptedException in main thread ", e);
! }
return errn;
}
public static void main(String args[]) {
int errn = test();
< prev index next >