8336465: C2: EA incorrectly/unnecessarily checks for clinits

Reviewed-by: kvn, thartmann
This commit is contained in:
Aleksey Shipilev 2024-07-19 08:34:36 +00:00
parent 0ddf54e222
commit b703be9cf6

View File

@ -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