On Fri, 26 Jun 2026 19:32:00 GMT, Dan Heidinga <[email protected]> wrote:
>> src/hotspot/share/classfile/classFileParser.cpp line 4164:
>>
>>> 4162: if (InstanceKlass::is_finalization_enabled() &&
>>> 4163: (m != nullptr) && !m->is_empty_method() &&
>>> 4164: m->method_holder()->access_flags().is_identity_class()) {
>>
>> Could we call ClassFileParser's ` is_identity_class()` here instead of going
>> through the method_holder?
>
> Fred pointed out my proposed change actually changes the meaning as my
> proposal checks the current class, not the class that defines the finalize
> method. This is different for a finalize method from an abstract value class
A finalizer in an abstract value class should probably still be registered for
identity subclasses; as otherwise, changing an abstract identity class with a
finalizer to an abstract value class with a finalizer would be a breaking
change as long as finalizers continue to exist.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2589#discussion_r3484336931