8264359: Compiler directives should enable DebugNonSafepoints when PrintAssembly is requested

Reviewed-by: kvn, thartmann
This commit is contained in:
Nils Eliasson 2021-04-06 06:47:49 +00:00
parent ec7b0028e8
commit 81325483d8
2 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#include "compiler/compilerOracle.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/globals_extension.hpp"
CompilerDirectives::CompilerDirectives() : _next(NULL), _match(NULL), _ref_count(0) {
_c1_store = new DirectiveSet(this);
@ -104,6 +105,10 @@ void DirectiveSet::finalize(outputStream* st) {
if (LogOption && !LogCompilation) {
st->print_cr("Warning: +LogCompilation must be set to enable compilation logging from directives");
}
if (PrintAssemblyOption && FLAG_IS_DEFAULT(DebugNonSafepoints)) {
warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
DebugNonSafepoints = true;
}
// if any flag has been modified - set directive as enabled
// unless it already has been explicitly set.

View File

@ -911,9 +911,6 @@ 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;
}
}
}