8041992: Fix of JDK-8034775 neglects to account for non-JIT VMs

Fri, 02 May 2014 06:24:39 +0200

author
anoll
date
Fri, 02 May 2014 06:24:39 +0200
changeset 7310
4356234e712a
parent 7309
c83362e7de6f
child 7311
327c00d0f091

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>

src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
test/compiler/startup/NumCompilerThreadsCheck.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Sat Mar 29 14:54:48 2014 +0400
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Fri May 02 06:24:39 2014 +0200
     1.3 @@ -2463,7 +2463,7 @@
     1.4  #endif
     1.5  
     1.6    // TieredCompilation needs at least 2 compiler threads.
     1.7 -  const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
     1.8 +  const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : CI_COMPILER_COUNT;
     1.9    status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
    1.10  
    1.11    return status;
     2.1 --- a/test/compiler/startup/NumCompilerThreadsCheck.java	Sat Mar 29 14:54:48 2014 +0400
     2.2 +++ b/test/compiler/startup/NumCompilerThreadsCheck.java	Fri May 02 06:24:39 2014 +0200
     2.3 @@ -30,11 +30,28 @@
     2.4  import com.oracle.java.testlibrary.*;
     2.5  
     2.6  public class NumCompilerThreadsCheck {
     2.7 +
     2.8    public static void main(String[] args) throws Exception {
     2.9      ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
    2.10      OutputAnalyzer out = new OutputAnalyzer(pb.start());
    2.11  
    2.12      String expectedOutput = "CICompilerCount of -1 is invalid";
    2.13      out.shouldContain(expectedOutput);
    2.14 +
    2.15 +    if (isZeroVm()) {
    2.16 +      String expectedLowWaterMarkText = "must be at least 0";
    2.17 +      out.shouldContain(expectedLowWaterMarkText);
    2.18 +    }
    2.19 +  }
    2.20 +
    2.21 +  private static boolean isZeroVm() {
    2.22 +    String vmName = System.getProperty("java.vm.name");
    2.23 +    if (vmName == null) {
    2.24 +      throw new RuntimeException("No VM name");
    2.25 +    }
    2.26 +    if (vmName.toLowerCase().contains("zero")) {
    2.27 +      return true;
    2.28 +    }
    2.29 +    return false;
    2.30    }
    2.31  }

mercurial