Skip to content

Commit 1b14157

Browse files
tobiasholensteinTobiHartmann
authored andcommitted
8280274: Guard printing code of Compile::print_method in PRODUCT
Reviewed-by: thartmann, neliasso
1 parent 2155afe commit 1b14157

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/hotspot/share/opto/compile.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ void Compile::inline_vector_reboxing_calls() {
23572357
CallGenerator* cg = _vector_reboxing_late_inlines.pop();
23582358
cg->do_late_inline();
23592359
if (failing()) return;
2360-
print_method(PHASE_INLINE_VECTOR_REBOX, cg->call_node());
2360+
print_method(PHASE_INLINE_VECTOR_REBOX, cg->call_node(), 3);
23612361
}
23622362
_vector_reboxing_late_inlines.trunc_to(0);
23632363
}
@@ -4815,10 +4815,11 @@ void Compile::sort_macro_nodes() {
48154815
}
48164816

48174817
void Compile::print_method(CompilerPhaseType cpt, int level) {
4818-
print_method_impl(cpt, CompilerPhaseTypeHelper::to_string(cpt), level);
4818+
print_method_impl(cpt, NOT_PRODUCT(CompilerPhaseTypeHelper::to_string(cpt) COMMA) level);
48194819
}
48204820

48214821
void Compile::print_method(CompilerPhaseType cpt, Node* n, int level) {
4822+
#ifndef PRODUCT
48224823
ResourceMark rm;
48234824
stringStream ss;
48244825
ss.print_raw(CompilerPhaseTypeHelper::to_string(cpt));
@@ -4827,10 +4828,11 @@ void Compile::print_method(CompilerPhaseType cpt, Node* n, int level) {
48274828
} else {
48284829
ss.print_raw(": NULL");
48294830
}
4830-
C->print_method_impl(cpt, ss.as_string(), level);
4831+
#endif
4832+
C->print_method_impl(cpt, NOT_PRODUCT(ss.as_string() COMMA) level);
48314833
}
48324834

4833-
void Compile::print_method_impl(CompilerPhaseType cpt, const char *name, int level) {
4835+
void Compile::print_method_impl(CompilerPhaseType cpt, NOT_PRODUCT(const char* name COMMA) int level) {
48344836
EventCompilerPhase event;
48354837
if (event.should_commit()) {
48364838
CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level);

src/hotspot/share/opto/compile.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,8 @@ class Compile : public Phase {
656656
bool should_print_igv(int level);
657657

658658
void print_method(CompilerPhaseType cpt, int level);
659-
void print_method(CompilerPhaseType cpt, Node* n, int level = 3);
660-
void print_method_impl(CompilerPhaseType cpt, const char *name, int level);
659+
void print_method(CompilerPhaseType cpt, Node* n, int level);
660+
void print_method_impl(CompilerPhaseType cpt, NOT_PRODUCT(const char* name COMMA) int level);
661661

662662
#ifndef PRODUCT
663663
void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false);

0 commit comments

Comments
 (0)