Class CompilerHints


public class CompilerHints extends AbstractResourceReader
  • Field Details

  • Constructor Details

    • CompilerHints

      private CompilerHints(String file, String resource)
  • Method Details

    • defaultList

      public static CompilerHints defaultList()
    • hintsFile

      public static String hintsFile()
    • fromResource

      public static CompilerHints fromResource(String resource)
    • fromFile

      public static CompilerHints fromFile(String file)
    • isHintCompatibleVM

      private static boolean isHintCompatibleVM()
      FIXME (low priority): check if supplied JVM is hint compatible. This test is applied to the Runner VM, not the Forked and may therefore be wrong if the forked VM is not the same JVM
    • get

      public Set<String> get()
    • read

      private Set<String> read()
    • getCompileCommandFiles

      public static List<String> getCompileCommandFiles(List<String> command)
      Parameters:
      command - command arguments list
      Returns:
      the compiler hint files specified by the command
    • addCompilerHints

      public static void addCompilerHints(List<String> command)
      We need to generate a compiler hints file such that it includes:
      • No compile command files are specified and no .hotspotrc file is available, then do JMH hints only
      • No compile command files are specified and .hotspotrc file is available, then do JMH hints + .hotspotrc
      • 1 to N compile command files are specified, then do JMH hints + all specified hints in files

      This is a departure from default JVM behavior as the JVM would normally just take the last hints file and ignore the rest.

      Parameters:
      command - all -XX:CompileCommandLine args will be removed and a merged file will be set
    • removeCompileCommandFiles

      private static void removeCompileCommandFiles(List<String> command, List<String> compileCommandFiles)
      Parameters:
      command - the compile command file options will be removed from this command
      compileCommandFiles - the compiler hint files specified by the command will be added to this list
    • mergeHintFiles

      private static String mergeHintFiles(List<String> compileCommandFiles)
    • blackholeMode

      private static CompilerHints.BlackholeMode blackholeMode()
    • blackholeSelect

      private static CompilerHints.BlackholeSelect blackholeSelect()
    • compilerBlackholesAvailable

      private static boolean compilerBlackholesAvailable()
    • debug

      private static void debug(String msg)
    • printBlackhole

      public static void printBlackhole(PrintStream out)
    • printWarnings

      public static void printWarnings(PrintStream out)