Skip to content

Commit 41c2564

Browse files
committed
Remove @LayerVerifiedOption from RuntimeOptionKeys
A native image can anyway never make assumptions about RuntimeOptionKey option-values. Thus, there is never the need to verify if a prev layer build uses the same as the current layer. And as for the default value for a RuntimeOptionKey, the last one, wins.
1 parent 9f790e3 commit 41c2564

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
628628
@Option(help = "Enable detection and runtime container configuration support.")//
629629
public static final HostedOptionKey<Boolean> UseContainerSupport = new HostedOptionKey<>(true);
630630

631-
@LayerVerifiedOption(kind = Kind.Changed, severity = Severity.Error)//
632631
@Option(help = "The size of each thread stack at run-time, in bytes.", type = OptionType.User)//
633632
public static final RuntimeOptionKey<Long> StackSize = new RuntimeOptionKey<>(0L);
634633

@@ -871,8 +870,6 @@ private static void validateZapNativeMemory(HostedOptionKey<Boolean> optionKey)
871870
/*
872871
* Isolate tear down options.
873872
*/
874-
875-
@LayerVerifiedOption(kind = Kind.Changed, severity = Severity.Error)//
876873
@Option(help = "The number of seconds before and between which tearing down an isolate gives a warning message. 0 implies no warning.")//
877874
public static final RuntimeOptionKey<Long> TearDownWarningSeconds = new RuntimeOptionKey<>(0L, RelevantForCompilationIsolates);
878875

@@ -1220,7 +1217,6 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
12201217
@Option(help = "The largest page size of machines that can run the image. The default of 0 automatically selects a typically suitable value.")//
12211218
protected static final HostedOptionKey<Integer> PageSize = new HostedOptionKey<>(0);
12221219

1223-
@LayerVerifiedOption(kind = Kind.Changed, severity = Severity.Error)//
12241220
@Option(help = "Physical memory size (in bytes). By default, the value is queried from the OS/container during VM startup.", type = OptionType.Expert)//
12251221
public static final RuntimeOptionKey<Long> MaxRAM = new RuntimeOptionKey<>(0L, RegisterForIsolateArgumentParser);
12261222

@@ -1253,7 +1249,6 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
12531249
@Option(help = "For internal purposes only. Disables type id result verification even when running with assertions enabled.", stability = OptionStability.EXPERIMENTAL, type = OptionType.Debug)//
12541250
public static final HostedOptionKey<Boolean> DisableTypeIdResultVerification = new HostedOptionKey<>(true);
12551251

1256-
@LayerVerifiedOption(kind = Kind.Changed, severity = Severity.Error)//
12571252
@Option(help = "Enables signal handling", stability = OptionStability.EXPERIMENTAL, type = Expert)//
12581253
public static final RuntimeOptionKey<Boolean> EnableSignalHandling = new RuntimeOptionKey<>(null, Immutable) {
12591254
@Override

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/imagelayer/HostedImageLayerBuildingSupport.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import com.oracle.svm.core.option.LayerVerifiedOption;
4545
import com.oracle.svm.core.option.LocatableMultiOptionValue.ValueWithOrigin;
4646
import com.oracle.svm.core.option.OptionUtils;
47+
import com.oracle.svm.core.option.RuntimeOptionKey;
4748
import com.oracle.svm.core.option.SubstrateOptionsParser;
4849
import com.oracle.svm.core.util.ArchiveSupport;
4950
import com.oracle.svm.core.util.UserError;
@@ -316,6 +317,7 @@ public static HostedImageLayerBuildingSupport initialize(HostedOptionValues valu
316317
record OptionLayerVerificationRequests(OptionDescriptor option, List<LayerVerifiedOption> requests) {
317318
OptionLayerVerificationRequests(OptionDescriptor option) {
318319
this(option, new ArrayList<>());
320+
assert !(option.getOptionKey() instanceof RuntimeOptionKey) : "LayerVerifiedOption annotation on NI runtime-option";
319321
}
320322
}
321323

0 commit comments

Comments
 (0)