@@ -715,10 +715,6 @@ public static boolean useLIRBackend() {
715
715
@ Option (help = "Check if native-toolchain is known to work with native-image" , type = Expert )//
716
716
public static final HostedOptionKey <Boolean > CheckToolchain = new HostedOptionKey <>(true );
717
717
718
- @ APIOption (name = "install-exit-handlers" )//
719
- @ Option (help = "Provide java.lang.Terminator exit handlers" , type = User )//
720
- public static final HostedOptionKey <Boolean > InstallExitHandlers = new HostedOptionKey <>(false );
721
-
722
718
@ Option (help = "When set to true, the image generator verifies that the image heap does not contain a home directory as a substring" , type = User , stability = OptionStability .STABLE )//
723
719
public static final HostedOptionKey <Boolean > DetectUserDirectoriesInImageHeap = new HostedOptionKey <>(false );
724
720
@@ -889,6 +885,16 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
889
885
/** Use {@link SubstrateOptions#getPageSize()} instead. */
890
886
@ Option (help = "The largest page size of machines that can run the image. The default of 0 automatically selects a typically suitable value." )//
891
887
protected static final HostedOptionKey <Integer > PageSize = new HostedOptionKey <>(0 );
888
+
889
+ /** Use {@link SubstrateOptions#needsExitHandlers()} instead. */
890
+ @ APIOption (name = "install-exit-handlers" )//
891
+ @ Option (help = "Provide java.lang.Terminator exit handlers" , type = User )//
892
+ protected static final HostedOptionKey <Boolean > InstallExitHandlers = new HostedOptionKey <>(false );
893
+ }
894
+
895
+ @ Fold
896
+ public static final boolean needsExitHandlers () {
897
+ return ConcealedOptions .InstallExitHandlers .getValue () || VMInspectionOptions .hasJfrSupport () || VMInspectionOptions .hasNativeMemoryTrackingSupport ();
892
898
}
893
899
894
900
@ Option (help = "Overwrites the available number of processors provided by the OS. Any value <= 0 means using the processor count from the OS." )//
0 commit comments