|
24 | 24 | */
|
25 | 25 | package com.oracle.svm.core;
|
26 | 26 |
|
27 |
| -import static com.oracle.svm.core.SubstrateOptions.DeprecatedOptions.TearDownFailureNanos; |
28 | 27 | import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.Immutable;
|
29 | 28 | import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.RegisterForIsolateArgumentParser;
|
30 | 29 | import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.RelevantForCompilationIsolates;
|
@@ -618,17 +617,13 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
|
618 | 617 | }
|
619 | 618 | };
|
620 | 619 |
|
621 |
| - public static final String TEAR_DOWN_WARNING_NANOS_ERROR = "Can't set both TearDownWarningSeconds and TearDownWarningNanos at the same time. Use TearDownWarningSeconds."; |
622 |
| - @Option(help = "The number of nanoseconds before and between which tearing down an isolate gives a warning message. 0 implies no warning.", // |
| 620 | + @Option(help = "The number of nanoseconds that the isolate teardown can take before warnings are printed. Disabled if less or equal to 0.", // |
623 | 621 | deprecated = true, deprecationMessage = "Use -XX:TearDownWarningSeconds=<secs> instead")//
|
624 |
| - public static final RuntimeOptionKey<Long> TearDownWarningNanos = new RuntimeOptionKey<>(0L, |
625 |
| - (key) -> UserError.guarantee(!(key.hasBeenSet() && TearDownWarningSeconds.hasBeenSet()), TEAR_DOWN_WARNING_NANOS_ERROR), |
626 |
| - RelevantForCompilationIsolates); |
| 622 | + public static final RuntimeOptionKey<Long> TearDownWarningNanos = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates); |
627 | 623 |
|
628 |
| - @Option(help = "The number of nanoseconds before tearing down an isolate gives a failure message and returns from a tear-down call. 0 implies no message.", // |
629 |
| - deprecated = true, deprecationMessage = "This call leaks resources. Instead, terminate java threads cooperatively, or use System#exit")// |
| 624 | + @Option(help = "The number of nanoseconds that the isolate teardown can take before a fatal error is thrown. Disabled if less or equal to 0.", // |
| 625 | + deprecated = true, deprecationMessage = "Use -XX:TearDownFailureSeconds=<secs> instead")// |
630 | 626 | public static final RuntimeOptionKey<Long> TearDownFailureNanos = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates);
|
631 |
| - |
632 | 627 | }
|
633 | 628 |
|
634 | 629 | @LayerVerifiedOption(kind = Kind.Changed, severity = Severity.Error)//
|
@@ -870,24 +865,18 @@ private static void validateZapNativeMemory(HostedOptionKey<Boolean> optionKey)
|
870 | 865 | }
|
871 | 866 | }
|
872 | 867 |
|
873 |
| - /* |
874 |
| - * Isolate tear down options. |
875 |
| - */ |
876 |
| - @Option(help = "The number of seconds before and between which tearing down an isolate gives a warning message. 0 implies no warning.")// |
877 |
| - public static final RuntimeOptionKey<Long> TearDownWarningSeconds = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates); |
878 |
| - |
879 | 868 | public static long getTearDownWarningNanos() {
|
880 |
| - if (TearDownWarningSeconds.hasBeenSet() && DeprecatedOptions.TearDownWarningNanos.hasBeenSet()) { |
881 |
| - throw new IllegalArgumentException(DeprecatedOptions.TEAR_DOWN_WARNING_NANOS_ERROR); |
882 |
| - } |
883 |
| - if (DeprecatedOptions.TearDownWarningNanos.hasBeenSet()) { |
884 |
| - return DeprecatedOptions.TearDownWarningNanos.getValue(); |
| 869 | + if (ConcealedOptions.TearDownWarningSeconds.getValue() != 0) { |
| 870 | + return TimeUtils.secondsToNanos(ConcealedOptions.TearDownWarningSeconds.getValue()); |
885 | 871 | }
|
886 |
| - return TearDownWarningSeconds.getValue() * TimeUtils.nanosPerSecond; |
| 872 | + return DeprecatedOptions.TearDownWarningNanos.getValue(); |
887 | 873 | }
|
888 | 874 |
|
889 | 875 | public static long getTearDownFailureNanos() {
|
890 |
| - return TearDownFailureNanos.getValue(); |
| 876 | + if (ConcealedOptions.TearDownFailureSeconds.getValue() != 0) { |
| 877 | + return TimeUtils.secondsToNanos(ConcealedOptions.TearDownFailureSeconds.getValue()); |
| 878 | + } |
| 879 | + return DeprecatedOptions.TearDownFailureNanos.getValue(); |
891 | 880 | }
|
892 | 881 |
|
893 | 882 | @Option(help = "Define the maximum number of stores for which the loop that zeroes out objects is unrolled.")//
|
@@ -1264,6 +1253,15 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
|
1264 | 1253 | @Option(help = "Avoid linker relocations for code and instead emit address computations.", type = OptionType.Expert) //
|
1265 | 1254 | @LayerVerifiedOption(severity = Severity.Error, kind = Kind.Changed, positional = false) //
|
1266 | 1255 | public static final HostedOptionKey<Boolean> RelativeCodePointers = new HostedOptionKey<>(false, SubstrateOptions::validateRelativeCodePointers);
|
| 1256 | + |
| 1257 | + /** Use {@link SubstrateOptions#getTearDownWarningNanos()} instead. */ |
| 1258 | + @Option(help = "The number of seconds that the isolate teardown can take before warnings are printed. Disabled if less or equal to 0.")// |
| 1259 | + public static final RuntimeOptionKey<Long> TearDownWarningSeconds = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates); |
| 1260 | + |
| 1261 | + /** Use {@link SubstrateOptions#getTearDownFailureNanos()} instead. */ |
| 1262 | + @Option(help = "The number of seconds that the isolate teardown can take before a fatal error is thrown. Disabled if less or equal to 0.")// |
| 1263 | + public static final RuntimeOptionKey<Long> TearDownFailureSeconds = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates); |
| 1264 | + |
1267 | 1265 | }
|
1268 | 1266 |
|
1269 | 1267 | @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