# HG changeset patch # User Doug Simon # Date 1438677047 -7200 # Node ID fb39402322145aa924b432f69c5d27293f6044c7 # Parent 4f6caa445b9210031c03cae77ba9ece31d0e4943 revived support for PrintFlags option diff -r 4f6caa445b92 -r fb3940232214 jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java --- a/jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java Tue Aug 04 00:47:34 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java Tue Aug 04 10:30:47 2015 +0200 @@ -29,12 +29,14 @@ import jdk.internal.jvmci.inittimer.*; /** - * - * @author dsimon - * + * This class contains methods for parsing JVMCI options and matching them against a set of + * {@link OptionDescriptors}. The {@link OptionDescriptors} are loaded from JVMCI jars, either + * {@linkplain JVMCIJarsOptionDescriptorsProvider directly} or via a {@link ServiceLoader}. */ public class OptionsParser { + private static final OptionValue PrintFlags = new OptionValue<>(false); + /** * A service for looking up {@link OptionDescriptor}s. */ @@ -124,6 +126,9 @@ optionName = option.substring(1, index); desc = odp == null ? OptionsLoader.options.get(optionName) : odp.get(optionName); } + if (desc == null && optionName.equals("PrintFlags")) { + desc = new OptionDescriptor("PrintFlags", Boolean.class, "Prints all JVMCI flags and exits", OptionsParser.class, "PrintFlags", PrintFlags); + } } if (desc == null) { List matches = fuzzyMatch(optionName); @@ -173,6 +178,10 @@ } else { setter.set(desc, value); } + + if (PrintFlags.getValue()) { + printFlags(); + } } private static long parseLong(String v) { @@ -238,9 +247,9 @@ return lines; } - public static void printFlags(SortedMap options, String prefix) { - System.out.println("[List of " + prefix + " options]"); - SortedMap sortedOptions = options; + public static void printFlags() { + System.out.println("[List of JVMCI options]"); + SortedMap sortedOptions = OptionsLoader.options; for (Map.Entry e : sortedOptions.entrySet()) { e.getKey(); OptionDescriptor desc = e.getValue();