On Thu, 18 Nov 2021 06:49:03 GMT, Kim Barrett <[email protected]> wrote:
>> src/hotspot/share/prims/jvm.cpp line 694:
>>
>>> 692:
>>> 693: JVM_ENTRY(jboolean, JVM_IsFinalizationEnabled(JNIEnv * env))
>>> 694: return InstanceKlass::finalization_enabled() ? JNI_TRUE : JNI_FALSE;
>>
>> missing indentation
>
> I think this could just be `return InstanceKlass::finalization_enabled();`.
> There is lots of code in this file and elsewhere that assumes C++ `bool`
> converts to `jboolean` appropriately.
One typical way for VM to pass the arguments to the library is via private
system properties. System::initPhase1 will save the VM properties in
`jdk.internal.misc.VM` and filters out the private properties from the system
properties returned from System::getProperties (see System::createProperties).
You can query the flag via
`jdk.internal.misc.VM.getProperty("jdk.finalization.disabled")` for example.
I don't see any issue moving the Finalizer class initialization after
initPhase1 since there is no finalizer during VM startup.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6442