< prev index next >
test/runtime/ReservedStack/ReservedStackTest.java
Print this page
*** 24,35 ****
/*
* @test ReservedStackTest
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.vm.annotation
! * @run main/othervm -Xint ReservedStackTest
! * @run main/othervm -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
*/
/* The exclusion of java.util.concurrent.locks.AbstractOwnableSynchronizer.setExclusiveOwnerThread()
* from the compilable methods is required to ensure that the test will be able
* to trigger a StackOverflowError on the right method.
--- 24,34 ----
/*
* @test ReservedStackTest
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.vm.annotation
! * @run main/othervm -XX:InlineSmallCode=4 -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
*/
/* The exclusion of java.util.concurrent.locks.AbstractOwnableSynchronizer.setExclusiveOwnerThread()
* from the compilable methods is required to ensure that the test will be able
* to trigger a StackOverflowError on the right method.
*** 159,168 ****
--- 158,168 ----
try {
lockAndCall(0);
} catch (StackOverflowError e) {
soe = e;
stackOverflowErrorReceived = true;
+ throw e;
}
}
private void lockAndCall(int i) {
index = i;
*** 192,208 ****
public void run() {
counter = 0;
decounter = deframe;
test.initialize();
recursiveCall();
- System.out.println("Framework got StackOverflowError at frame = " + counter);
- System.out.println("Test started execution at frame = " + (counter - deframe));
String result = test.getResult();
// The feature is not fully implemented on all platforms,
// corruptions are still possible.
if (isSupportedPlatform && !result.contains("PASSED")) {
- System.out.println(result);
throw new Error(result);
} else {
// Either the test passed or this platform is not supported.
// On not supported platforms, we only expect the VM to
// not crash during the test. This is especially important
--- 192,205 ----
*** 287,297 ****
}
}
public static void main(String[] args) throws Exception {
initIsSupportedPlatform();
! for (int i = 0; i < 1000; i++) {
// Each iteration has to be executed by a new thread. The test
// relies on the random size area pushed by the VM at the beginning
// of the stack of each Java thread it creates.
Thread thread = new Thread(new RunWithSOEContext(new ReentrantLockTest(), 256));
thread.start();
--- 284,294 ----
}
}
public static void main(String[] args) throws Exception {
initIsSupportedPlatform();
! for (int i = 0; i < 100; i++) {
// Each iteration has to be executed by a new thread. The test
// relies on the random size area pushed by the VM at the beginning
// of the stack of each Java thread it creates.
Thread thread = new Thread(new RunWithSOEContext(new ReentrantLockTest(), 256));
thread.start();
< prev index next >