56 thread.join(); 57 assertTrue(r.result.equals("PASSED"), r.result); 58 ++passed; 59 } catch (InterruptedException ex) { 60 } 61 } 62 System.out.println("RESULT: " + (passed == 1000 ? "PASSED" : "FAILED")); 63 } 64 65 public static void main(String[] args) { 66 new ReservedStackAccessTest().stackAccessTest(); 67 } 68 69 @Test 70 public void run() throws IOException, InterruptedException { 71 Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); 72 List<String> vmArgs = SubprocessUtil.withoutDebuggerArguments(SubprocessUtil.getVMCommandLine()); 73 vmArgs.add("-XX:+UseJVMCICompiler"); 74 vmArgs.add("-Dgraal.Inline=false"); 75 vmArgs.add("-XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread"); 76 Subprocess proc = SubprocessUtil.java(vmArgs, ReservedStackAccessTest.class.getName()); 77 boolean passed = false; 78 for (String line : proc.output) { 79 if (line.equals("RESULT: PASSED")) { 80 passed = true; 81 } 82 } 83 if (!passed) { 84 for (String line : proc.output) { 85 System.err.println("" + line); 86 } 87 } 88 assertTrue(passed); 89 } 90 91 static class ReentrantLockTest { 92 93 private ReentrantLock[] lockArray; 94 // Frame sizes vary a lot between interpreted code and compiled code 95 // so the lock array has to be big enough to cover all cases. 96 // If test fails with message "Not conclusive test", try to increase 97 // LOCK_ARRAY_SIZE value 98 private static final int LOCK_ARRAY_SIZE = 8192; 99 private boolean stackOverflowErrorReceived; 100 StackOverflowError soe = null; 101 int index = -1; 102 103 public void initialize() { 104 lockArray = new ReentrantLock[LOCK_ARRAY_SIZE]; 105 for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { 106 lockArray[i] = new ReentrantLock(); | 56 thread.join(); 57 assertTrue(r.result.equals("PASSED"), r.result); 58 ++passed; 59 } catch (InterruptedException ex) { 60 } 61 } 62 System.out.println("RESULT: " + (passed == 1000 ? "PASSED" : "FAILED")); 63 } 64 65 public static void main(String[] args) { 66 new ReservedStackAccessTest().stackAccessTest(); 67 } 68 69 @Test 70 public void run() throws IOException, InterruptedException { 71 Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); 72 List<String> vmArgs = SubprocessUtil.withoutDebuggerArguments(SubprocessUtil.getVMCommandLine()); 73 vmArgs.add("-XX:+UseJVMCICompiler"); 74 vmArgs.add("-Dgraal.Inline=false"); 75 vmArgs.add("-XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread"); 76 77 // Avoid SOE in HotSpotJVMCIRuntime.adjustCompilationLevel 78 vmArgs.add("-Dgraal.CompileGraalWithC1Only=false"); 79 80 Subprocess proc = SubprocessUtil.java(vmArgs, ReservedStackAccessTest.class.getName()); 81 boolean passed = false; 82 for (String line : proc.output) { 83 if (line.equals("RESULT: PASSED")) { 84 passed = true; 85 } 86 } 87 if (!passed) { 88 System.err.println(proc); 89 } 90 assertTrue(passed); 91 } 92 93 static class ReentrantLockTest { 94 95 private ReentrantLock[] lockArray; 96 // Frame sizes vary a lot between interpreted code and compiled code 97 // so the lock array has to be big enough to cover all cases. 98 // If test fails with message "Not conclusive test", try to increase 99 // LOCK_ARRAY_SIZE value 100 private static final int LOCK_ARRAY_SIZE = 8192; 101 private boolean stackOverflowErrorReceived; 102 StackOverflowError soe = null; 103 int index = -1; 104 105 public void initialize() { 106 lockArray = new ReentrantLock[LOCK_ARRAY_SIZE]; 107 for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { 108 lockArray[i] = new ReentrantLock(); |