From b703be9cf633796456991279d07cbde98ad7f1aa Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 19 Jul 2024 08:34:36 +0000 Subject: [PATCH] 8336465: C2: EA incorrectly/unnecessarily checks for clinits Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/bytecodeInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 3b1e9cbd855..9e0fa6f760f 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -86,10 +86,10 @@ static bool is_init_with_ea(ciMethod* callee_method, if (!C->do_escape_analysis() || !EliminateAllocations) { return false; // EA is off } - if (callee_method->is_initializer()) { + if (callee_method->is_object_initializer()) { return true; // constructor } - if (caller_method->is_initializer() && + if (caller_method->is_object_initializer() && caller_method != C->method() && caller_method->holder()->is_subclass_of(callee_method->holder())) { return true; // super constructor is called from inlined constructor