From 5830c03e531f2c84c31a61cd49c40bb5e549a91d Mon Sep 17 00:00:00 2001 From: Matthijs Bijman Date: Fri, 10 Feb 2023 13:38:42 +0000 Subject: [PATCH] 8302004: InlineTree should consult replay file in release build Reviewed-by: phh, xliu --- src/hotspot/share/opto/bytecodeInfo.cpp | 12 ++++-------- src/hotspot/share/opto/parse.hpp | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 13f58b90c44..461866f69d8 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -114,7 +114,7 @@ static bool is_unboxing_method(ciMethod* callee_method, Compile* C) { // positive filter: should callee be inlined? bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, - int caller_bci, NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile) { + int caller_bci, bool& should_delay, ciCallProfile& profile) { // Allows targeted inlining if (C->directive()->should_inline(callee_method)) { set_msg("force inline by CompileCommand"); @@ -128,7 +128,6 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, return true; } -#ifndef PRODUCT int inline_depth = inline_level() + 1; if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth, should_delay)) { if (should_delay) { @@ -139,7 +138,6 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, _forced_inline = true; return true; } -#endif int size = callee_method->code_size_for_inlining(); @@ -199,7 +197,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, // negative filter: should callee NOT be inlined? bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_method, - int caller_bci, NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile) { + int caller_bci, bool& should_delay, ciCallProfile& profile) { const char* fail_msg = NULL; // First check all inlining restrictions which are required for correctness @@ -243,7 +241,6 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met return true; } -#ifndef PRODUCT int inline_depth = inline_level() + 1; if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth, should_delay)) { if (should_delay) { @@ -263,7 +260,6 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met set_msg("disallowed by ciReplay"); return true; } -#endif if (callee_method->force_inline()) { set_msg("force inline by annotation"); @@ -379,11 +375,11 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, _forced_inline = false; // Reset // 'should_delay' can be overridden during replay compilation - if (!should_inline(callee_method, caller_method, caller_bci, NOT_PRODUCT_ARG(should_delay) profile)) { + if (!should_inline(callee_method, caller_method, caller_bci, should_delay, profile)) { return false; } // 'should_delay' can be overridden during replay compilation - if (should_not_inline(callee_method, caller_method, caller_bci, NOT_PRODUCT_ARG(should_delay) profile)) { + if (should_not_inline(callee_method, caller_method, caller_bci, should_delay, profile)) { return false; } diff --git a/src/hotspot/share/opto/parse.hpp b/src/hotspot/share/opto/parse.hpp index 919f731c0de..f06e242f444 100644 --- a/src/hotspot/share/opto/parse.hpp +++ b/src/hotspot/share/opto/parse.hpp @@ -76,12 +76,12 @@ protected: bool should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, - NOT_PRODUCT_ARG(bool& should_delay) + bool& should_delay, ciCallProfile& profile); bool should_not_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, - NOT_PRODUCT_ARG(bool& should_delay) + bool& should_delay, ciCallProfile& profile); bool is_not_reached(ciMethod* callee_method, ciMethod* caller_method,