Skip to content

Commit bb6540c

Browse files
author
Christian Wimmer
committed
[GR-50267] Deprecate options that we plan to remove in a future GraalVM release.
PullRequest: graal/16166
2 parents 80a015b + 613b9c5 commit bb6540c

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ public static void updateMaxJavaStackTraceDepth(EconomicMap<OptionKey<?>, Object
400400
@Option(help = "Verify naming conventions during image construction.")//
401401
public static final HostedOptionKey<Boolean> VerifyNamingConventions = new HostedOptionKey<>(false);
402402

403-
@Option(help = "Enable support for threads and and thread-local variables (disable for single-threaded implementation)")//
403+
@Option(help = "Enable support for threads and and thread-local variables (disable for single-threaded implementation)", //
404+
deprecated = true, deprecationMessage = "This special mode to build images that cannot start any additional threads has no benefits anymore and will be removed in a future release")//
404405
public static final HostedOptionKey<Boolean> MultiThreaded = new HostedOptionKey<>(true);
405406

406407
@Option(help = "Use only a writable native image heap (requires ld.gold linker)")//
@@ -409,7 +410,7 @@ public static void updateMaxJavaStackTraceDepth(EconomicMap<OptionKey<?>, Object
409410
@Option(help = "Force no direct relocations to be present in the text section of the generated image", type = OptionType.Debug) //
410411
public static final HostedOptionKey<Boolean> NoDirectRelocationsInText = new HostedOptionKey<>(true);
411412

412-
@Option(help = "Support multiple isolates.") //
413+
@Option(help = "Support multiple isolates.", deprecated = true, deprecationMessage = "This option disables a major feature of GraalVM Native Image and will be removed in a future release") //
413414
public static final HostedOptionKey<Boolean> SpawnIsolates = new HostedOptionKey<>(true);
414415

415416
@Option(help = "At CEntryPoints check that the passed IsolateThread is valid.") //
@@ -968,7 +969,7 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String ol
968969
@Option(help = "Verify type states computed by the static analysis at run time. This is useful when diagnosing problems in the static analysis, but reduces peak performance significantly.", type = OptionType.Debug)//
969970
public static final HostedOptionKey<Boolean> VerifyTypes = new HostedOptionKey<>(false);
970971

971-
@Option(help = "Run reachability handlers concurrently during analysis.", type = Expert)//
972+
@Option(help = "Run reachability handlers concurrently during analysis.", type = Expert, deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 22.2 and will be removed in a future release")//
972973
public static final HostedOptionKey<Boolean> RunReachabilityHandlersConcurrently = new HostedOptionKey<>(true);
973974

974975
@Option(help = "Force many trampolines to be needed for inter-method calls. Normally trampolines are only used when a method destination is outside the range of a pc-relative branch instruction.", type = OptionType.Debug)//
@@ -990,7 +991,8 @@ public Boolean getValueOrDefault(UnmodifiableEconomicMap<OptionKey<?>, Object> v
990991
}
991992
};
992993

993-
@Option(help = "Instead of abort, only warn if image builder classes are found on the image class-path.", type = OptionType.Debug)//
994+
@Option(help = "Instead of abort, only warn if image builder classes are found on the image class-path.", type = OptionType.Debug, //
995+
deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 23.0 and will be removed in a future release")//
994996
public static final HostedOptionKey<Boolean> AllowDeprecatedBuilderClassesOnImageClasspath = new HostedOptionKey<>(false);
995997

996998
@Option(help = "file:doc-files/MissingRegistrationHelp.txt")//
@@ -1023,7 +1025,7 @@ public enum ReportingMode {
10231025
@Option(help = "Enable and disable normal processing of flags relating to experimental options.", type = OptionType.Expert, stability = OptionStability.EXPERIMENTAL) //
10241026
public static final HostedOptionKey<Boolean> UnlockExperimentalVMOptions = new HostedOptionKey<>(false);
10251027

1026-
@Option(help = "Force using legacy method handle intrinsics.", type = Expert) //
1028+
@Option(help = "Force using legacy method handle intrinsics.", type = Expert, deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 23.1 and will be removed in a future release") //
10271029
public static final HostedOptionKey<Boolean> UseOldMethodHandleIntrinsics = new HostedOptionKey<>(false);
10281030

10291031
@Option(help = "Include all classes, methods, and fields from given modules", type = OptionType.Debug) //

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/FeatureHandler.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
import java.util.function.Function;
3838
import java.util.stream.Collectors;
3939

40-
import jdk.graal.compiler.debug.DebugContext;
41-
import jdk.graal.compiler.options.Option;
4240
import org.graalvm.nativeimage.ImageSingletons;
4341
import org.graalvm.nativeimage.hosted.Feature;
4442

@@ -62,6 +60,9 @@
6260
import com.oracle.svm.util.ReflectionUtil;
6361
import com.oracle.svm.util.ReflectionUtil.ReflectionUtilError;
6462

63+
import jdk.graal.compiler.debug.DebugContext;
64+
import jdk.graal.compiler.options.Option;
65+
6566
/**
6667
* Handles the registration and iterations of {@link Feature features}.
6768
*/
@@ -77,7 +78,8 @@ private static List<String> userEnabledFeatures() {
7778
return Options.Features.getValue().values();
7879
}
7980

80-
@Option(help = "Allow using deprecated @AutomaticFeature annotation. If set to false, an error is shown instead of a warning.")//
81+
@Option(help = "Allow using deprecated @AutomaticFeature annotation. If set to false, an error is shown instead of a warning.", //
82+
deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 22.3 and will be removed in a future release")//
8183
public static final HostedOptionKey<Boolean> AllowDeprecatedAutomaticFeature = new HostedOptionKey<>(true);
8284
}
8385

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SVMHost.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ public InlineBeforeAnalysisGraphDecoder createInlineBeforeAnalysisGraphDecoder(B
745745
}
746746

747747
public static class Options {
748-
@Option(help = "Enable the behavior of old GraalVM versions. When enabled, interfaces not available for the current platform are filtered.")//
748+
@Option(help = "Enable the behavior of old GraalVM versions. When enabled, interfaces not available for the current platform are filtered.", //
749+
deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 21.2 and will be removed in a future release")//
749750
public static final HostedOptionKey<Boolean> PlatformInterfaceCompatibilityMode = new HostedOptionKey<>(false);
750751
}
751752

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/classinitialization/ClassInitializationOptions.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131

3232
import java.util.function.Function;
3333

34-
import jdk.graal.compiler.options.Option;
35-
import jdk.graal.compiler.options.OptionType;
36-
3734
import com.oracle.svm.core.option.APIOption;
3835
import com.oracle.svm.core.option.HostedOptionKey;
3936
import com.oracle.svm.core.option.LocatableMultiOptionValue;
4037
import com.oracle.svm.util.LogUtils;
4138

39+
import jdk.graal.compiler.options.Option;
40+
import jdk.graal.compiler.options.OptionType;
41+
4242
public final class ClassInitializationOptions {
4343

4444
private static class InitializationValueTransformer implements Function<Object, Object> {
@@ -92,7 +92,8 @@ private static class InitializationValueEager extends InitializationValueTransfo
9292
@Option(help = "A comma-separated list of classes appended with their initialization strategy (':build_time', ':rerun', or ':run_time')", type = OptionType.User)//
9393
public static final HostedOptionKey<LocatableMultiOptionValue.Strings> ClassInitialization = new HostedOptionKey<>(LocatableMultiOptionValue.Strings.build());
9494

95-
@Option(help = "Instead of abort, only warn if --initialize-at-build-time= is used.", type = OptionType.Debug)//
95+
@Option(help = "Instead of abort, only warn if --initialize-at-build-time= is used.", type = OptionType.Debug, //
96+
deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 23.0 and will be removed in a future release")//
9697
public static final HostedOptionKey<Boolean> AllowDeprecatedInitializeAllClassesAtBuildTime = new HostedOptionKey<>(false);
9798

9899
@Option(help = "Prints class initialization info for all classes detected by analysis.", type = OptionType.Debug)//
@@ -103,7 +104,7 @@ private static class InitializationValueEager extends InitializationValueTransfo
103104

104105
@APIOption(name = "strict-image-heap", deprecated = "'--strict-image-heap' is now the default. You can remove the option.") //
105106
@Option(help = "Enable the strict image heap mode that allows all classes to be used at build-time but also requires types of all objects in the heap to be explicitly marked for build-time initialization.", //
106-
type = OptionType.User, deprecated = true, deprecationMessage = "The strict image heap mode is now the default. You can remove the option.") //
107+
type = OptionType.User, deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 24.0 and will be removed in a future release") //
107108
public static final HostedOptionKey<Boolean> StrictImageHeap = new HostedOptionKey<>(true, k -> {
108109
if (k.hasBeenSet() && Boolean.FALSE.equals(k.getValue())) {
109110
LogUtils.warning("The non-strict image heap mode should be avoided as it is deprecated and marked for removal.");

0 commit comments

Comments
 (0)