Skip to content

Commit 1c9f5c6

Browse files
committed
Refactor CustomHostedOptions to ProvidedHostedOptions
1 parent a703c33 commit 1c9f5c6

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This file contains support for building images with JDWP debugging support
22

3-
CustomHostedOptions = JDWP CopyNativeJDWPLibrary
3+
ProvidedHostedOptions = JDWP CopyNativeJDWPLibrary
44

55
ImageBuilderModulePath = ${.}/builder/svm-jdwp-common.jar:${.}/builder/svm-jdwp-resident.jar
66

77
Args = -H:+UnlockExperimentalVMOptions \
88
-H:+JDWP \
9-
-H:-UnlockExperimentalVMOptions
9+
-H:-UnlockExperimentalVMOptions

substratevm/mx.substratevm/macro-truffle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleR
5050
--add-exports org.graalvm.truffle/com.oracle.truffle.object.basic=ALL-UNNAMED \
5151
--add-exports org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED
5252

53-
CustomHostedOptions = \
53+
ProvidedHostedOptions = \
5454
PrintStaticTruffleBoundaries \
5555
TruffleCheckNeverPartOfCompilation \
5656
TruffleCheckFrameImplementation \

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/APIOptionHandler.java

+13-3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ record PathsOptionInfo(String delimiter, BundleMember.Role role) {
9696
record HostedOptionInfo(Boolean isStable, Boolean isBoolean) {
9797
}
9898

99+
private final HostedOptionInfo injectedKnownHostedRegularOptionInfo = new HostedOptionInfo(false, false);
100+
private final HostedOptionInfo injectedKnownHostedBooleanOptionInfo = new HostedOptionInfo(false, true);
101+
99102
private final Map<String, HostedOptionInfo> allOptionNames;
100103

101104
private int numberOfActiveUnlockExperimentalVMOptions = 0;
@@ -287,10 +290,17 @@ private static String startLowerCase(String str) {
287290
return str.substring(0, 1).toLowerCase(Locale.ROOT) + str.substring(1);
288291
}
289292

290-
private final HostedOptionInfo injectedKnownHostedOptionInfo = new HostedOptionInfo(false, false);
291-
292293
void injectKnownHostedOption(String optionName) {
293-
allOptionNames.put(optionName, injectedKnownHostedOptionInfo);
294+
String baseOptionName;
295+
HostedOptionInfo optionInfo;
296+
if (optionName.endsWith("=")) {
297+
baseOptionName = optionName.substring(0, optionName.length() - 1);
298+
optionInfo = injectedKnownHostedRegularOptionInfo;
299+
} else {
300+
baseOptionName = optionName;
301+
optionInfo = injectedKnownHostedBooleanOptionInfo;
302+
}
303+
allOptionNames.put(baseOptionName, optionInfo);
294304
}
295305

296306
@Override

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/MacroOptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private void applyEnabled(MacroOption.EnabledOption enabledOption, String argume
9898
}
9999

100100
enabledOption.forEachPropertyValue(config,
101-
"CustomHostedOptions", nativeImage.apiOptionHandler::injectKnownHostedOption, NativeImage.MANY_SPACES_REGEX);
101+
"ProvidedHostedOptions", nativeImage.apiOptionHandler::injectKnownHostedOption, NativeImage.MANY_SPACES_REGEX);
102102
enabledOption.forEachPropertyValue(config,
103103
"ImageProvidedJars", entry -> nativeImage.addImageProvidedJars(Path.of(entry)), PATH_SEPARATOR_REGEX);
104104
enabledOption.forEachPropertyValue(config,

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ public boolean processMetaInfResource(Path classpathEntry, Path resourceRoot, Pa
779779
}
780780
forEachPropertyValue(properties.get("JavaArgs"), NativeImage.this::addImageBuilderJavaArgs, resolver);
781781
forEachPropertyValue(properties.get("Args"), args, resolver);
782-
forEachPropertyValue(properties.get("CustomHostedOptions"), apiOptionHandler::injectKnownHostedOption, resolver);
782+
forEachPropertyValue(properties.get("ProvidedHostedOptions"), apiOptionHandler::injectKnownHostedOption, resolver);
783783
} else {
784784
args.accept(oH(type.optionKey) + resourceRoot.relativize(resourcePath));
785785
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Args = --add-reads=org.graalvm.nativeimage.junitsupport=ALL-UNNAMED \
22
--link-at-build-time=com.oracle.svm.junit
33

4-
CustomHostedOptions = TestFile
4+
ProvidedHostedOptions = TestFile=

substratevm/src/com.oracle.svm.truffle.tck/src/META-INF/native-image/native-image.properties

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ JavaArgs = --add-exports org.graalvm.nativeimage.base/com.oracle.svm.util=ALL-UN
1919
--add-exports jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
2020
--add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED
2121

22-
CustomHostedOptions = \
23-
TruffleTCKPermissionsReportFile \
24-
TruffleTCKPermissionsExcludeFiles \
25-
TruffleTCKPermissionsMaxStackTraceDepth \
26-
TruffleTCKPermissionsMaxErrors
22+
ProvidedHostedOptions = \
23+
TruffleTCKPermissionsReportFile= \
24+
TruffleTCKPermissionsExcludeFiles= \
25+
TruffleTCKPermissionsMaxStackTraceDepth= \
26+
TruffleTCKPermissionsMaxErrors=

truffle/src/com.oracle.truffle.runtime/src/META-INF/native-image/org.graalvm.truffle/truffle-runtime/native-image.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Args = --macro:truffle-svm \
77
JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleRuntime \
88
-Dgraalvm.ForcePolyglotInvalid=false
99

10-
CustomHostedOptions = \
10+
ProvidedHostedOptions = \
1111
PrintStaticTruffleBoundaries \
1212
TruffleCheckNeverPartOfCompilation \
1313
TruffleCheckFrameImplementation \

0 commit comments

Comments
 (0)