--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java 2019-03-16 05:57:59.869412161 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java 2019-03-16 05:57:59.505409588 +0100 @@ -41,6 +41,7 @@ import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.common.NativeImageReinitialize; +import jdk.vm.ci.services.Services; /** * The {@link #defaultOptions()} method returns the options values initialized in a HotSpot VM. The @@ -89,15 +90,14 @@ } /** - * Global options. The values for these options are initialized by parsing the file denoted by - * the {@code VM.getSavedProperty(String) saved} system property named - * {@value #GRAAL_OPTIONS_FILE_PROPERTY_NAME} if the file exists followed by parsing the options - * encoded in saved system properties whose names start with - * {@value #GRAAL_OPTION_PROPERTY_PREFIX}. Key/value pairs are parsed from the aforementioned - * file with {@link Properties#load(java.io.Reader)}. + * Gets and parses options based on {@linkplain Services#getSavedProperties() saved system + * properties}. The values for these options are initialized by parsing the file denoted by the + * {@value #GRAAL_OPTIONS_FILE_PROPERTY_NAME} property followed by parsing the options encoded + * in properties whose names start with {@value #GRAAL_OPTION_PROPERTY_PREFIX}. Key/value pairs + * are parsed from the aforementioned file with {@link Properties#load(java.io.Reader)}. */ @SuppressWarnings("try") - private static OptionValues initializeOptions() { + public static EconomicMap, Object> parseOptions() { EconomicMap, Object> values = OptionValues.newOptionMap(); try (InitTimer t = timer("InitializeOptions")) { @@ -142,7 +142,17 @@ } OptionsParser.parseOptions(optionSettings, values, loader); - return new OptionValues(values); + return values; } } + + /** + * Substituted by + * {@code com.oracle.svm.graal.hotspot.libgraal.Target_org_graalvm_compiler_hotspot_HotSpotGraalOptionValues} + * to update {@code com.oracle.svm.core.option.RuntimeOptionValues.singleton()} instead of + * creating a new {@link OptionValues} object. + */ + private static OptionValues initializeOptions() { + return new OptionValues(parseOptions()); + } }