43 return;
44 }
45
46 testWith(500, 500);
47 }
48
49 static int test_loop(int x) {
50 int sum = 0;
51 if (x != 0) {
52 // Long running loop without safepoint.
53 for (int y = 1; y < Integer.MAX_VALUE; ++y) {
54 if (y % x == 0) ++sum;
55 }
56 }
57 return sum;
58 }
59
60 public static void testWith(int sfpt_interval, int timeout_delay) throws Exception {
61 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
62 "-XX:+UnlockDiagnosticVMOptions",
63 "-XX:+SafepointTimeout",
64 "-XX:+SafepointALot",
65 "-XX:+AbortVMOnSafepointTimeout",
66 "-XX:SafepointTimeoutDelay=" + timeout_delay,
67 "-XX:GuaranteedSafepointInterval=" + sfpt_interval,
68 "-XX:-TieredCompilation",
69 "-XX:-UseCountedLoopSafepoints",
70 "-XX:LoopStripMiningIter=0",
71 "-XX:LoopUnrollLimit=0",
72 "-XX:CompileCommand=compileonly,TestAbortVMOnSafepointTimeout::test_loop",
73 "-Xcomp",
74 "-XX:-CreateCoredumpOnCrash",
75 "-Xms64m",
76 "TestAbortVMOnSafepointTimeout",
77 "runTestLoop"
78 );
79
80 OutputAnalyzer output = new OutputAnalyzer(pb.start());
81 if (Platform.isWindows()) {
82 output.shouldMatch("Safepoint sync time longer than");
|
43 return;
44 }
45
46 testWith(500, 500);
47 }
48
49 static int test_loop(int x) {
50 int sum = 0;
51 if (x != 0) {
52 // Long running loop without safepoint.
53 for (int y = 1; y < Integer.MAX_VALUE; ++y) {
54 if (y % x == 0) ++sum;
55 }
56 }
57 return sum;
58 }
59
60 public static void testWith(int sfpt_interval, int timeout_delay) throws Exception {
61 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
62 "-XX:+UnlockDiagnosticVMOptions",
63 "-XX:-UseBiasedLocking",
64 "-XX:+SafepointTimeout",
65 "-XX:+SafepointALot",
66 "-XX:+AbortVMOnSafepointTimeout",
67 "-XX:SafepointTimeoutDelay=" + timeout_delay,
68 "-XX:GuaranteedSafepointInterval=" + sfpt_interval,
69 "-XX:-TieredCompilation",
70 "-XX:-UseCountedLoopSafepoints",
71 "-XX:LoopStripMiningIter=0",
72 "-XX:LoopUnrollLimit=0",
73 "-XX:CompileCommand=compileonly,TestAbortVMOnSafepointTimeout::test_loop",
74 "-Xcomp",
75 "-XX:-CreateCoredumpOnCrash",
76 "-Xms64m",
77 "TestAbortVMOnSafepointTimeout",
78 "runTestLoop"
79 );
80
81 OutputAnalyzer output = new OutputAnalyzer(pb.start());
82 if (Platform.isWindows()) {
83 output.shouldMatch("Safepoint sync time longer than");
|