On Thu, 18 Nov 2021 07:40:34 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Do we even have to have a flag on Java side? It looks like these calls are >> only done as the upcalls from VM, so we might just keep the flag on VM side? > > @shipilev not sure what you mean by "a flag on the Java side". The Java code > just queries the VM for the finalization enabled/disabled state and uses that > to control things. Yeah, "flag" is `Holder.ENABLED` here. I mean, are Java methods `registerFinalizer` and `runFinalization` called only by VM? If so, can VM check the whole thing on VM side, without going to Java and asking back from there? ------------- PR: https://git.openjdk.java.net/jdk/pull/6442