mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 16:44:36 +02:00
8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs
Allow 0 compiler threads if no JIT is used. Reviewed-by: kvn, dholmes
This commit is contained in:
parent
d9056b18ee
commit
a92fee550e
2 changed files with 18 additions and 1 deletions
|
@ -2399,7 +2399,7 @@ bool Arguments::check_vm_args_consistency() {
|
||||||
status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
|
status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
|
||||||
|
|
||||||
// TieredCompilation needs at least 2 compiler threads.
|
// TieredCompilation needs at least 2 compiler threads.
|
||||||
const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
|
const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : CI_COMPILER_COUNT;
|
||||||
status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
|
status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
|
||||||
|
|
||||||
if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
|
if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
|
||||||
|
|
|
@ -30,11 +30,28 @@
|
||||||
import com.oracle.java.testlibrary.*;
|
import com.oracle.java.testlibrary.*;
|
||||||
|
|
||||||
public class NumCompilerThreadsCheck {
|
public class NumCompilerThreadsCheck {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
|
||||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||||
|
|
||||||
String expectedOutput = "CICompilerCount of -1 is invalid";
|
String expectedOutput = "CICompilerCount of -1 is invalid";
|
||||||
out.shouldContain(expectedOutput);
|
out.shouldContain(expectedOutput);
|
||||||
|
|
||||||
|
if (isZeroVm()) {
|
||||||
|
String expectedLowWaterMarkText = "must be at least 0";
|
||||||
|
out.shouldContain(expectedLowWaterMarkText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isZeroVm() {
|
||||||
|
String vmName = System.getProperty("java.vm.name");
|
||||||
|
if (vmName == null) {
|
||||||
|
throw new RuntimeException("No VM name");
|
||||||
|
}
|
||||||
|
if (vmName.toLowerCase().contains("zero")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue