-
Bug
-
Resolution: Fixed
-
P5
-
11, 13, 15, 16, 17
-
b17
Found this while working on jcstress support, see CODETOOLS-7902865. jcstress opts in to PrintAssembly for the particular method by using the compile directive:
https://github.com/openjdk/jcstress/blob/master/jcstress-core/src/main/java/org/openjdk/jcstress/TestExecutor.java#L246-L248
When supplied on JVM command line, -XX:+PrintAssembly implicitly enables -XX:+DebugNonSafepoints:
jint Arguments::apply_ergo() {
...
if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
DebugNonSafepoints = true;
}
...
}
When -XX:CompileCommand=Print is used, it also opts in:
void compilerOracle_init() {
...
if (has_command(CompileCommand::Print)) {
if (PrintAssembly) {
warning("CompileCommand and/or %s file contains 'print' commands, but PrintAssembly is also enabled", default_cc_file);
} else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) {
warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
DebugNonSafepoints = true;
}
}
...
But CompilerDirectives do not seem to have the same heuristics.
https://github.com/openjdk/jcstress/blob/master/jcstress-core/src/main/java/org/openjdk/jcstress/TestExecutor.java#L246-L248
When supplied on JVM command line, -XX:+PrintAssembly implicitly enables -XX:+DebugNonSafepoints:
jint Arguments::apply_ergo() {
...
if (PrintAssembly && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
warning("PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output");
DebugNonSafepoints = true;
}
...
}
When -XX:CompileCommand=Print is used, it also opts in:
void compilerOracle_init() {
...
if (has_command(CompileCommand::Print)) {
if (PrintAssembly) {
warning("CompileCommand and/or %s file contains 'print' commands, but PrintAssembly is also enabled", default_cc_file);
} else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) {
warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
DebugNonSafepoints = true;
}
}
...
But CompilerDirectives do not seem to have the same heuristics.
- relates to
-
CODETOOLS-7902865 jcstress: Enable -XX:+DebugNonSafepoints if available to get more verbose disassembly
-
- Closed
-