Mercurial > hg > graal-jvmci-8
changeset 22399:fb3940232214
revived support for PrintFlags option
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 04 Aug 2015 10:30:47 +0200 |
parents | 4f6caa445b92 |
children | b876144b52f3 |
files | jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java |
diffstat | 1 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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<Boolean> 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<OptionDescriptor> 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<String, OptionDescriptor> options, String prefix) { - System.out.println("[List of " + prefix + " options]"); - SortedMap<String, OptionDescriptor> sortedOptions = options; + public static void printFlags() { + System.out.println("[List of JVMCI options]"); + SortedMap<String, OptionDescriptor> sortedOptions = OptionsLoader.options; for (Map.Entry<String, OptionDescriptor> e : sortedOptions.entrySet()) { e.getKey(); OptionDescriptor desc = e.getValue();