< prev index next >

test/runtime/ReservedStack/ReservedStackTest.java

Print this page
rev 12502 : 8172144: AArch64: Implement "JEP 270: Reserved Stack Areas for Critical Sections"
Reviewed-by: duke


 183         public RunWithSOEContext(ReentrantLockTest test, int deframe) {
 184             this.test = test;
 185             this.deframe = deframe;
 186         }
 187 
 188         @Override
 189         @jdk.internal.vm.annotation.ReservedStackAccess
 190         public void run() {
 191             counter = 0;
 192             decounter = deframe;
 193             test.initialize();
 194             recursiveCall();
 195             System.out.println("Framework got StackOverflowError at frame = " + counter);
 196             System.out.println("Test started execution at frame = " + (counter - deframe));
 197             String result = test.getResult();
 198             // The feature is not fully implemented on all platforms,
 199             // corruptions are still possible.
 200             boolean supportedPlatform =
 201                 Platform.isAix() ||
 202                 (Platform.isLinux() &&
 203                   (Platform.isPPC() || Platform.isS390x() || Platform.isX64() || Platform.isX86())) ||
 204                 Platform.isOSX() ||
 205                 Platform.isSolaris();
 206             if (supportedPlatform && !result.contains("PASSED")) {
 207                 System.out.println(result);
 208                 throw new Error(result);
 209             } else {
 210                 // Either the test passed or this platform is not supported.
 211                 // On not supported platforms, we only expect the VM to
 212                 // not crash during the test. This is especially important
 213                 // on Windows where the detection of SOE in annotated
 214                 // sections is implemented but the reserved zone mechanism
 215                 // to avoid the corruption cannot be implemented yet
 216                 // because of JDK-8067946
 217                 System.out.println("PASSED");
 218             }
 219         }
 220 
 221         void recursiveCall() {
 222             // Unused local variables to increase the frame size
 223             long l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19;




 183         public RunWithSOEContext(ReentrantLockTest test, int deframe) {
 184             this.test = test;
 185             this.deframe = deframe;
 186         }
 187 
 188         @Override
 189         @jdk.internal.vm.annotation.ReservedStackAccess
 190         public void run() {
 191             counter = 0;
 192             decounter = deframe;
 193             test.initialize();
 194             recursiveCall();
 195             System.out.println("Framework got StackOverflowError at frame = " + counter);
 196             System.out.println("Test started execution at frame = " + (counter - deframe));
 197             String result = test.getResult();
 198             // The feature is not fully implemented on all platforms,
 199             // corruptions are still possible.
 200             boolean supportedPlatform =
 201                 Platform.isAix() ||
 202                 (Platform.isLinux() &&
 203                   (Platform.isPPC() || Platform.isS390x() || Platform.isX64() || Platform.isX86()) || Platform.isAArch64()) ||
 204                 Platform.isOSX() ||
 205                 Platform.isSolaris();
 206             if (supportedPlatform && !result.contains("PASSED")) {
 207                 System.out.println(result);
 208                 throw new Error(result);
 209             } else {
 210                 // Either the test passed or this platform is not supported.
 211                 // On not supported platforms, we only expect the VM to
 212                 // not crash during the test. This is especially important
 213                 // on Windows where the detection of SOE in annotated
 214                 // sections is implemented but the reserved zone mechanism
 215                 // to avoid the corruption cannot be implemented yet
 216                 // because of JDK-8067946
 217                 System.out.println("PASSED");
 218             }
 219         }
 220 
 221         void recursiveCall() {
 222             // Unused local variables to increase the frame size
 223             long l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19;


< prev index next >