8139046: Compiler Control: IGVPrintLevel directive should set PrintIdealGraph
Make !PrintIdealGraph a synonym for PrintIdealGraphLevel=-1 => print nothing Reviewed-by: simonis, phh, neliasso
This commit is contained in:
parent
be278bc564
commit
892d998587
@ -507,8 +507,8 @@ void CompilerConfig::ergo_initialize() {
|
|||||||
if (!IncrementalInline) {
|
if (!IncrementalInline) {
|
||||||
AlwaysIncrementalInline = false;
|
AlwaysIncrementalInline = false;
|
||||||
}
|
}
|
||||||
if (PrintIdealGraphLevel > 0) {
|
if (FLAG_IS_CMDLINE(PrintIdealGraph) && !PrintIdealGraph) {
|
||||||
FLAG_SET_ERGO(PrintIdealGraph, true);
|
FLAG_SET_ERGO(PrintIdealGraphLevel, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) {
|
if (!UseTypeSpeculation && FLAG_IS_DEFAULT(TypeProfileLevel)) {
|
||||||
|
@ -366,10 +366,12 @@
|
|||||||
\
|
\
|
||||||
notproduct(intx, PrintIdealGraphLevel, 0, \
|
notproduct(intx, PrintIdealGraphLevel, 0, \
|
||||||
"Level of detail of the ideal graph printout. " \
|
"Level of detail of the ideal graph printout. " \
|
||||||
"System-wide value, 0=nothing is printed, 4=all details printed. "\
|
"System-wide value, -1=printing is disabled, " \
|
||||||
|
"0=print nothing except IGVPrintLevel directives, " \
|
||||||
|
"4=all details printed. " \
|
||||||
"Level of detail of printouts can be set on a per-method level " \
|
"Level of detail of printouts can be set on a per-method level " \
|
||||||
"as well by using CompileCommand=option.") \
|
"as well by using CompileCommand=option.") \
|
||||||
range(0, 4) \
|
range(-1, 4) \
|
||||||
\
|
\
|
||||||
notproduct(intx, PrintIdealGraphPort, 4444, \
|
notproduct(intx, PrintIdealGraphPort, 4444, \
|
||||||
"Ideal graph printer to network port") \
|
"Ideal graph printer to network port") \
|
||||||
|
@ -529,9 +529,7 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
|
|||||||
_log(ci_env->log()),
|
_log(ci_env->log()),
|
||||||
_failure_reason(NULL),
|
_failure_reason(NULL),
|
||||||
_congraph(NULL),
|
_congraph(NULL),
|
||||||
#ifndef PRODUCT
|
NOT_PRODUCT(_printer(NULL) COMMA)
|
||||||
_printer(IdealGraphPrinter::printer()),
|
|
||||||
#endif
|
|
||||||
_dead_node_list(comp_arena()),
|
_dead_node_list(comp_arena()),
|
||||||
_dead_node_count(0),
|
_dead_node_count(0),
|
||||||
_node_arena(mtCompiler),
|
_node_arena(mtCompiler),
|
||||||
@ -559,11 +557,6 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
C = this;
|
C = this;
|
||||||
#ifndef PRODUCT
|
|
||||||
if (_printer != NULL) {
|
|
||||||
_printer->set_compile(this);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
CompileWrapper cw(this);
|
CompileWrapper cw(this);
|
||||||
|
|
||||||
if (CITimeVerbose) {
|
if (CITimeVerbose) {
|
||||||
@ -725,7 +718,7 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
|
|||||||
// Drain the list.
|
// Drain the list.
|
||||||
Finish_Warm();
|
Finish_Warm();
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (_printer && _printer->should_print(1)) {
|
if (should_print(1)) {
|
||||||
_printer->print_inlining();
|
_printer->print_inlining();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -821,9 +814,7 @@ Compile::Compile( ciEnv* ci_env,
|
|||||||
_log(ci_env->log()),
|
_log(ci_env->log()),
|
||||||
_failure_reason(NULL),
|
_failure_reason(NULL),
|
||||||
_congraph(NULL),
|
_congraph(NULL),
|
||||||
#ifndef PRODUCT
|
NOT_PRODUCT(_printer(NULL) COMMA)
|
||||||
_printer(NULL),
|
|
||||||
#endif
|
|
||||||
_dead_node_list(comp_arena()),
|
_dead_node_list(comp_arena()),
|
||||||
_dead_node_count(0),
|
_dead_node_count(0),
|
||||||
_node_arena(mtCompiler),
|
_node_arena(mtCompiler),
|
||||||
@ -4590,7 +4581,7 @@ void Compile::end_method(int level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (_printer && _printer->should_print(level)) {
|
if (_method != NULL && should_print(level)) {
|
||||||
_printer->end_method();
|
_printer->end_method();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -614,9 +614,9 @@ class Compile : public Phase {
|
|||||||
|
|
||||||
Ticks _latest_stage_start_counter;
|
Ticks _latest_stage_start_counter;
|
||||||
|
|
||||||
void begin_method() {
|
void begin_method(int level = 1) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (_printer && _printer->should_print(1)) {
|
if (_method != NULL && should_print(level)) {
|
||||||
_printer->begin_method();
|
_printer->begin_method();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -625,7 +625,17 @@ class Compile : public Phase {
|
|||||||
|
|
||||||
bool should_print(int level = 1) {
|
bool should_print(int level = 1) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
return (_printer && _printer->should_print(level));
|
if (PrintIdealGraphLevel < 0) { // disabled by the user
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool need = directive()->IGVPrintLevelOption >= level;
|
||||||
|
if (need && !_printer) {
|
||||||
|
_printer = IdealGraphPrinter::printer();
|
||||||
|
assert(_printer != NULL, "_printer is NULL when we need it!");
|
||||||
|
_printer->set_compile(this);
|
||||||
|
}
|
||||||
|
return need;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -75,10 +75,6 @@ const char *IdealGraphPrinter::ASSEMBLY_ELEMENT = "assembly";
|
|||||||
int IdealGraphPrinter::_file_count = 0;
|
int IdealGraphPrinter::_file_count = 0;
|
||||||
|
|
||||||
IdealGraphPrinter *IdealGraphPrinter::printer() {
|
IdealGraphPrinter *IdealGraphPrinter::printer() {
|
||||||
if (!PrintIdealGraph) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
JavaThread *thread = JavaThread::current();
|
JavaThread *thread = JavaThread::current();
|
||||||
if (!thread->is_Compiler_thread()) return NULL;
|
if (!thread->is_Compiler_thread()) return NULL;
|
||||||
|
|
||||||
@ -633,7 +629,7 @@ void IdealGraphPrinter::walk_nodes(Node *start, bool edges, VectorSet* temp_set)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IdealGraphPrinter::print_method(const char *name, int level) {
|
void IdealGraphPrinter::print_method(const char *name, int level) {
|
||||||
if (should_print(level)) {
|
if (C->should_print(level)) {
|
||||||
print(name, (Node *) C->root());
|
print(name, (Node *) C->root());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -691,11 +687,6 @@ void IdealGraphPrinter::print(const char *name, Node *node) {
|
|||||||
_xml->flush();
|
_xml->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should method be printed?
|
|
||||||
bool IdealGraphPrinter::should_print(int level) {
|
|
||||||
return C->directive()->IGVPrintLevelOption >= level;
|
|
||||||
}
|
|
||||||
|
|
||||||
void IdealGraphPrinter::init_file_stream(const char* file_name, bool use_multiple_files, bool append) {
|
void IdealGraphPrinter::init_file_stream(const char* file_name, bool use_multiple_files, bool append) {
|
||||||
ThreadCritical tc;
|
ThreadCritical tc;
|
||||||
if (use_multiple_files && _file_count != 0) {
|
if (use_multiple_files && _file_count != 0) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -126,7 +126,6 @@ class IdealGraphPrinter : public CHeapObj<mtCompiler> {
|
|||||||
void end_method();
|
void end_method();
|
||||||
void print_method(const char *name, int level = 0);
|
void print_method(const char *name, int level = 0);
|
||||||
void print(const char *name, Node *root);
|
void print(const char *name, Node *root);
|
||||||
bool should_print(int level);
|
|
||||||
void set_compile(Compile* compile) {C = compile; }
|
void set_compile(Compile* compile) {C = compile; }
|
||||||
void update_compiled_method(ciMethod* current_method);
|
void update_compiled_method(ciMethod* current_method);
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -2842,8 +2842,8 @@ void Parse::do_one_bytecode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
IdealGraphPrinter *printer = C->printer();
|
if (C->should_print(1)) {
|
||||||
if (printer && printer->should_print(1)) {
|
IdealGraphPrinter* printer = C->printer();
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
|
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
|
||||||
bool old = printer->traverse_outs();
|
bool old = printer->traverse_outs();
|
||||||
|
Loading…
Reference in New Issue
Block a user