From daa9ebf35b10e092f943c8c15936425ca1b29e55 Mon Sep 17 00:00:00 2001 From: MBaesken Date: Tue, 20 Aug 2024 09:26:44 +0200 Subject: [PATCH] add suggestion from Dean Long --- src/hotspot/share/opto/bytecodeInfo.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index bada47a7c46bb..a75c4d80f77c8 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -315,13 +315,8 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met int invoke_count = caller_method->interpreter_invocation_count(); assert(invoke_count != 0, "require invocation count greater than zero"); double freq = (double)call_site_count / (double)invoke_count; - double min_freq = 0.0; - int cp_min_inv = CompilationPolicy::min_invocations(); - if (cp_min_inv == 0) { - min_freq = MinInlineFrequencyRatio; - } else { - min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / cp_min_inv); - } + int cp_min_inv = MAX2(1, CompilationPolicy::min_invocations()); + double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / cp_min_inv); if (freq < min_freq) { set_msg("low call site frequency");