Package org.openjdk.jmh.runner
Class CompilerHints
- java.lang.Object
-
- org.openjdk.jmh.runner.AbstractResourceReader
-
- org.openjdk.jmh.runner.CompilerHints
-
public class CompilerHints extends AbstractResourceReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CompilerHints.BlackholeMode
private static class
CompilerHints.BlackholeSelect
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
BLACKHOLE_AUTODETECT_NAME
(package private) static java.lang.String
BLACKHOLE_DEBUG_NAME
(package private) static boolean
BLACKHOLE_MODE_AUTODETECT
(package private) static boolean
BLACKHOLE_MODE_DEBUG
(package private) static java.lang.String
BLACKHOLE_MODE_NAME
private static CompilerHints.BlackholeMode
blackholeMode
private static CompilerHints.BlackholeSelect
blackholeSelect
private static CompilerHints
defaultList
(package private) static java.lang.String[]
HINT_COMPATIBLE_JVMS
private java.util.Set<java.lang.String>
hints
private static java.lang.String
hintsFile
(package private) static java.lang.String
JVM_ZING
static java.lang.String
LIST
(package private) static java.lang.String
XX_COMPILE_COMMAND_FILE
-
Constructor Summary
Constructors Modifier Constructor Description private
CompilerHints(java.lang.String file, java.lang.String resource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addCompilerHints(java.util.List<java.lang.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 filesprivate static CompilerHints.BlackholeMode
blackholeMode()
private static CompilerHints.BlackholeSelect
blackholeSelect()
private static boolean
compilerBlackholesAvailable()
private static void
debug(java.lang.String msg)
static CompilerHints
defaultList()
static CompilerHints
fromFile(java.lang.String file)
static CompilerHints
fromResource(java.lang.String resource)
java.util.Set<java.lang.String>
get()
static java.util.List<java.lang.String>
getCompileCommandFiles(java.util.List<java.lang.String> command)
static java.lang.String
hintsFile()
private static boolean
isHintCompatibleVM()
FIXME (low priority): check if supplied JVM is hint compatible.private static java.lang.String
mergeHintFiles(java.util.List<java.lang.String> compileCommandFiles)
static void
printBlackhole(java.io.PrintStream out)
static void
printWarnings(java.io.PrintStream out)
private java.util.Set<java.lang.String>
read()
private static void
removeCompileCommandFiles(java.util.List<java.lang.String> command, java.util.List<java.lang.String> compileCommandFiles)
-
Methods inherited from class org.openjdk.jmh.runner.AbstractResourceReader
getReaders
-
-
-
-
Field Detail
-
LIST
public static final java.lang.String LIST
- See Also:
- Constant Field Values
-
HINT_COMPATIBLE_JVMS
static final java.lang.String[] HINT_COMPATIBLE_JVMS
-
JVM_ZING
static final java.lang.String JVM_ZING
- See Also:
- Constant Field Values
-
defaultList
private static volatile CompilerHints defaultList
-
hintsFile
private static volatile java.lang.String hintsFile
-
hints
private final java.util.Set<java.lang.String> hints
-
XX_COMPILE_COMMAND_FILE
static final java.lang.String XX_COMPILE_COMMAND_FILE
- See Also:
- Constant Field Values
-
BLACKHOLE_MODE_NAME
static final java.lang.String BLACKHOLE_MODE_NAME
- See Also:
- Constant Field Values
-
BLACKHOLE_AUTODETECT_NAME
static final java.lang.String BLACKHOLE_AUTODETECT_NAME
- See Also:
- Constant Field Values
-
BLACKHOLE_DEBUG_NAME
static final java.lang.String BLACKHOLE_DEBUG_NAME
- See Also:
- Constant Field Values
-
BLACKHOLE_MODE_AUTODETECT
static final boolean BLACKHOLE_MODE_AUTODETECT
-
BLACKHOLE_MODE_DEBUG
static final boolean BLACKHOLE_MODE_DEBUG
-
blackholeMode
private static CompilerHints.BlackholeMode blackholeMode
-
blackholeSelect
private static CompilerHints.BlackholeSelect blackholeSelect
-
-
Method Detail
-
defaultList
public static CompilerHints defaultList()
-
hintsFile
public static java.lang.String hintsFile()
-
fromResource
public static CompilerHints fromResource(java.lang.String resource)
-
fromFile
public static CompilerHints fromFile(java.lang.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 java.util.Set<java.lang.String> get()
-
read
private java.util.Set<java.lang.String> read()
-
getCompileCommandFiles
public static java.util.List<java.lang.String> getCompileCommandFiles(java.util.List<java.lang.String> command)
- Parameters:
command
- command arguments list- Returns:
- the compiler hint files specified by the command
-
addCompilerHints
public static void addCompilerHints(java.util.List<java.lang.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(java.util.List<java.lang.String> command, java.util.List<java.lang.String> compileCommandFiles)
- Parameters:
command
- the compile command file options will be removed from this commandcompileCommandFiles
- the compiler hint files specified by the command will be added to this list
-
mergeHintFiles
private static java.lang.String mergeHintFiles(java.util.List<java.lang.String> compileCommandFiles)
-
blackholeMode
private static CompilerHints.BlackholeMode blackholeMode()
-
blackholeSelect
private static CompilerHints.BlackholeSelect blackholeSelect()
-
compilerBlackholesAvailable
private static boolean compilerBlackholesAvailable()
-
debug
private static void debug(java.lang.String msg)
-
printBlackhole
public static void printBlackhole(java.io.PrintStream out)
-
printWarnings
public static void printWarnings(java.io.PrintStream out)
-
-