Mercurial > hg > truffle
comparison test/compiler/startup/NumCompilerThreadsCheck.java @ 20596:4356234e712a
8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
Summary: Allow 0 compiler threads if no JIT is used.
Reviewed-by: kvn, dholmes
Contributed-by: Severin Gehwolf <sgehwolf@redhat.com>
author | anoll |
---|---|
date | Fri, 02 May 2014 06:24:39 +0200 |
parents | 2eda90444a0d |
children |
comparison
equal
deleted
inserted
replaced
20595:c83362e7de6f | 20596:4356234e712a |
---|---|
28 * @library /testlibrary | 28 * @library /testlibrary |
29 */ | 29 */ |
30 import com.oracle.java.testlibrary.*; | 30 import com.oracle.java.testlibrary.*; |
31 | 31 |
32 public class NumCompilerThreadsCheck { | 32 public class NumCompilerThreadsCheck { |
33 | |
33 public static void main(String[] args) throws Exception { | 34 public static void main(String[] args) throws Exception { |
34 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1"); | 35 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1"); |
35 OutputAnalyzer out = new OutputAnalyzer(pb.start()); | 36 OutputAnalyzer out = new OutputAnalyzer(pb.start()); |
36 | 37 |
37 String expectedOutput = "CICompilerCount of -1 is invalid"; | 38 String expectedOutput = "CICompilerCount of -1 is invalid"; |
38 out.shouldContain(expectedOutput); | 39 out.shouldContain(expectedOutput); |
40 | |
41 if (isZeroVm()) { | |
42 String expectedLowWaterMarkText = "must be at least 0"; | |
43 out.shouldContain(expectedLowWaterMarkText); | |
44 } | |
45 } | |
46 | |
47 private static boolean isZeroVm() { | |
48 String vmName = System.getProperty("java.vm.name"); | |
49 if (vmName == null) { | |
50 throw new RuntimeException("No VM name"); | |
51 } | |
52 if (vmName.toLowerCase().contains("zero")) { | |
53 return true; | |
54 } | |
55 return false; | |
39 } | 56 } |
40 } | 57 } |