Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-60379] Make InternalResourceCache#useInternalResources compilation constant. #10345

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ final class InternalResourceCache {

/**
* Recomputed before the analyses by a substitution in the {@code TruffleBaseFeature} based on
* the {@code CopyLanguageResources} option value. The field must not be declared as
* {@code final} to make the substitution function correctly.
* the {@code CopyLanguageResources} option value. The field must not qualify as a Java language
* constant (as defined in JLS 15.28) to prevent the Java compiler from inlining its value.
*/
private static boolean useInternalResources = true;
private static final boolean useInternalResources = Boolean.TRUE.booleanValue();
private static boolean useExternalDirectoryInNativeImage = true;

private final String id;
Expand Down Expand Up @@ -292,8 +292,9 @@ private static String sanitize(String pathElement) {
}

/**
* Returns true if internal resources are enabled. Internal resources can be disabled in the
* native image using {-H:-CopyLanguageResources} option.
* Returns true if internal resources are enabled. Internal resources are disabled in the native
* image when both the copying and inclusion of language resources are turned off. This can be
* achieved by using the {@code -H:-IncludeLanguageResources} option.
*/
public static boolean usesInternalResources() {
return useInternalResources;
Expand Down
Loading