# HG changeset patch # User Thomas Wuerthinger # Date 1307547727 -7200 # Node ID 0017f484608ce1f5518fa0e20aa7d02d45ecd608 # Parent 8681191723f3d094a3ce001597a077a51db4032d Made boolean options more robust to also allow -G:Time or -G:Meter. diff -r 8681191723f3 -r 0017f484608c graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotOptions.java --- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotOptions.java Wed Jun 08 17:27:31 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotOptions.java Wed Jun 08 17:42:07 2011 +0200 @@ -52,10 +52,12 @@ } else { int index = option.indexOf('='); if (index == -1) { - return false; + fieldName = option; + valueString = null; + } else { + fieldName = option.substring(0, index); + valueString = option.substring(index + 1); } - fieldName = option.substring(0, index); - valueString = option.substring(index + 1); } Field f; @@ -70,7 +72,11 @@ } else if (f.getType() == Integer.TYPE) { value = Integer.parseInt(valueString); } else if (f.getType() == Boolean.TYPE) { - value = Boolean.parseBoolean(valueString); + if (valueString == null || valueString.length() == 0) { + value = true; + } else { + value = Boolean.parseBoolean(valueString); + } } else if (f.getType() == String.class) { value = valueString; } diff -r 8681191723f3 -r 0017f484608c src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Wed Jun 08 17:27:31 2011 +0200 +++ b/src/share/vm/runtime/arguments.cpp Wed Jun 08 17:42:07 2011 +0200 @@ -2699,7 +2699,7 @@ sprintf(temp, "%s/graal/com.oracle.max.graal.graphviz/bin", graal_dir); scp_p->add_prefix(temp); *scp_assembly_required_p = true; - } else if (match_option(option, "-G:", &tail)) { // -graal:xxxx + } else if (match_option(option, "-G:", &tail)) { // -G:XXX // Option for the graal compiler. if (PrintVMOptions) { tty->print_cr("graal option %s", tail);