RFR: 8320522: Remove code related to `RegisterFinalizersAtInit`

Coleen Phillimore coleenp at openjdk.org
Wed Apr 17 20:11:59 UTC 2024


On Wed, 17 Apr 2024 18:42:29 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

> Remove the code related to -XX:[+-]RegisterFinalizersAtInit in JDK23.
> 
> `make test-tier1` passed with this change

src/hotspot/share/classfile/classFileParser.cpp line 4191:

> 4189:   // See documentation of InstanceKlass::can_be_fastpath_allocated().
> 4190:   assert(ik->size_helper() > 0, "layout_helper is initialized");
> 4191:   if (ik->is_abstract() || ik->is_interface()

TIL what this bit was.  There are some comments in the interpreters that claim that the bit will be set if there are finalizers, which is no longer true.  The comments look like:

  // test to see if it has a finalizer or is malformed in some way

src/hotspot/share/oops/instanceKlass.cpp line 1517:

> 1515:   instanceOop i;
> 1516: 
> 1517:   i = (instanceOop)Universe::heap()->obj_allocate(this, size, CHECK_NULL);

You could change to return without 'i'.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18823#discussion_r1569459880
PR Review Comment: https://git.openjdk.org/jdk/pull/18823#discussion_r1569420317


More information about the hotspot-dev mailing list