From 2560a63773ad8223e42d3ecf5bdcaaec30b001ee Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Thu, 20 Mar 2025 12:32:22 +0000 Subject: [PATCH] 8352131: [REDO] C2: Print compilation bailouts with PrintCompilation compile command Reviewed-by: thartmann, kvn, epeter --- src/hotspot/share/compiler/compileBroker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index c34d9eb785e..bbdb3a536dd 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -2340,7 +2340,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { } } - DirectivesStack::release(directive); if (!ci_env.failing() && !task->is_success()) { assert(ci_env.failure_reason() != nullptr, "expect failure reason"); @@ -2374,7 +2373,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { if (CompilationLog::log() != nullptr) { CompilationLog::log()->log_failure(thread, task, failure_reason, retry_message); } - if (PrintCompilation) { + if (PrintCompilation || directive->PrintCompilationOption) { FormatBufferResource msg = retry_message != nullptr ? FormatBufferResource("COMPILE SKIPPED: %s (%s)", failure_reason, retry_message) : FormatBufferResource("COMPILE SKIPPED: %s", failure_reason); @@ -2382,6 +2381,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { } } + DirectivesStack::release(directive); + methodHandle method(thread, task->method()); DTRACE_METHOD_COMPILE_END_PROBE(method, compiler_name(task_level), task->is_success());