changeset 22405:0d437f833141

moved JVMCI option parsing back into Java
author Doug Simon <doug.simon@oracle.com>
date Tue, 04 Aug 2015 01:09:31 +0200
parents 4ea139d40e91
children 12f996348026
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/OptionsVerifierTest.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLGetOptionBuiltin.java graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLSetOptionBuiltin.java mx.graal/mx_graal.py mx.graal/suite.py
diffstat 10 files changed, 28 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/OptionsVerifierTest.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/OptionsVerifierTest.java	Tue Aug 04 01:09:31 2015 +0200
@@ -47,7 +47,7 @@
     public void verifyOptions() throws IOException {
         try (Classpath cp = new Classpath()) {
             HashSet<Class<?>> checked = new HashSet<>();
-            for (Options opts : ServiceLoader.load(Options.class, getClass().getClassLoader())) {
+            for (OptionDescriptors opts : ServiceLoader.load(OptionDescriptors.class, getClass().getClassLoader())) {
                 for (OptionDescriptor desc : opts) {
                     OptionsVerifier.checkClass(desc.getDeclaringClass(), desc, checked, cp);
                 }
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java	Tue Aug 04 01:09:31 2015 +0200
@@ -22,13 +22,14 @@
  */
 package com.oracle.graal.hotspot.amd64;
 
-import static jdk.internal.jvmci.hotspot.InitTimer.*;
+import static jdk.internal.jvmci.inittimer.InitTimer.*;
 
 import java.util.*;
 
 import jdk.internal.jvmci.amd64.*;
 import jdk.internal.jvmci.code.*;
 import jdk.internal.jvmci.hotspot.*;
+import jdk.internal.jvmci.inittimer.*;
 import jdk.internal.jvmci.meta.*;
 import jdk.internal.jvmci.runtime.*;
 import jdk.internal.jvmci.service.*;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java	Tue Aug 04 01:09:31 2015 +0200
@@ -22,6 +22,7 @@
  */
 package com.oracle.graal.hotspot;
 
+import static com.oracle.graal.hotspot.CompileTheWorld.Options.*;
 import static jdk.internal.jvmci.compiler.Compiler.*;
 
 import java.io.*;
@@ -38,8 +39,8 @@
 import jdk.internal.jvmci.hotspot.*;
 import jdk.internal.jvmci.meta.*;
 import jdk.internal.jvmci.options.*;
-import jdk.internal.jvmci.options.OptionUtils.OptionConsumer;
 import jdk.internal.jvmci.options.OptionValue.OverrideScope;
+import jdk.internal.jvmci.options.OptionsParser.OptionConsumer;
 import jdk.internal.jvmci.runtime.*;
 
 import com.oracle.graal.compiler.*;
@@ -47,8 +48,6 @@
 import com.oracle.graal.debug.*;
 import com.oracle.graal.debug.internal.*;
 
-import static com.oracle.graal.hotspot.CompileTheWorld.Options.*;
-
 /**
  * This class implements compile-the-world functionality with JVMCI.
  */
@@ -117,14 +116,14 @@
         /**
          * Creates a {@link Config} object by parsing a set of space separated override options.
          *
-         * @param options a space separated set of option value settings with each option setting in
-         *            a format compatible with
-         *            {@link OptionUtils#parseOption(String, OptionConsumer)}. Ignored if null.
+         * @param options a space or hash separated set of option value settings with each option
+         *            setting in a format compatible with {@link OptionsParser#parseOption}. Ignored
+         *            if null.
          */
         public Config(String options) {
             if (options != null) {
-                for (String option : options.split("\\s+")) {
-                    OptionUtils.parseOption(option, this);
+                for (String option : options.split("\\s+|#")) {
+                    OptionsParser.parseOption(option, this, null);
                 }
             }
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Tue Aug 04 01:09:31 2015 +0200
@@ -26,7 +26,7 @@
 import static com.oracle.graal.debug.GraalDebugConfig.*;
 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.Options.*;
 import static jdk.internal.jvmci.common.UnsafeAccess.*;
-import static jdk.internal.jvmci.hotspot.InitTimer.*;
+import static jdk.internal.jvmci.inittimer.InitTimer.*;
 
 import java.lang.reflect.*;
 import java.util.*;
@@ -35,6 +35,7 @@
 import jdk.internal.jvmci.code.stack.*;
 import jdk.internal.jvmci.common.*;
 import jdk.internal.jvmci.hotspot.*;
+import jdk.internal.jvmci.inittimer.*;
 import jdk.internal.jvmci.meta.*;
 import jdk.internal.jvmci.options.*;
 import jdk.internal.jvmci.runtime.*;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java	Tue Aug 04 01:09:31 2015 +0200
@@ -22,16 +22,16 @@
  */
 package com.oracle.graal.hotspot;
 
+import static com.oracle.graal.compiler.common.GraalOptions.*;
+import static jdk.internal.jvmci.inittimer.InitTimer.*;
+import jdk.internal.jvmci.hotspot.*;
+import jdk.internal.jvmci.inittimer.*;
+import jdk.internal.jvmci.meta.*;
+import jdk.internal.jvmci.service.*;
+
 import com.oracle.graal.compiler.common.spi.*;
 import com.oracle.graal.debug.*;
-import com.oracle.graal.debug.Debug.*;
-
-import jdk.internal.jvmci.hotspot.*;
-import jdk.internal.jvmci.meta.*;
-import jdk.internal.jvmci.service.*;
-import static com.oracle.graal.compiler.common.GraalOptions.*;
-import static jdk.internal.jvmci.hotspot.InitTimer.*;
-
+import com.oracle.graal.debug.Debug.Scope;
 import com.oracle.graal.hotspot.meta.*;
 import com.oracle.graal.hotspot.stubs.*;
 import com.oracle.graal.nodes.spi.*;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Tue Aug 04 01:09:31 2015 +0200
@@ -30,6 +30,7 @@
 
 import jdk.internal.jvmci.common.*;
 import jdk.internal.jvmci.hotspot.*;
+import jdk.internal.jvmci.inittimer.*;
 import jdk.internal.jvmci.options.*;
 
 import com.oracle.graal.debug.*;
--- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLGetOptionBuiltin.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLGetOptionBuiltin.java	Tue Aug 04 01:09:31 2015 +0200
@@ -39,7 +39,7 @@
     @Specialization
     @TruffleBoundary
     public Object getOption(String name) {
-        TruffleCompilerOptions_Options options = new TruffleCompilerOptions_Options();
+        TruffleCompilerOptions_OptionDescriptors options = new TruffleCompilerOptions_OptionDescriptors();
         for (OptionDescriptor option : options) {
             if (option.getName().equals(name)) {
                 return convertValue(option.getOptionValue().getValue());
--- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLSetOptionBuiltin.java	Mon Aug 03 10:45:40 2015 -0700
+++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/builtins/SLSetOptionBuiltin.java	Tue Aug 04 01:09:31 2015 +0200
@@ -39,7 +39,7 @@
     @Specialization
     @TruffleBoundary
     public Object setOption(String name, Object value) {
-        TruffleCompilerOptions_Options options = new TruffleCompilerOptions_Options();
+        TruffleCompilerOptions_OptionDescriptors options = new TruffleCompilerOptions_OptionDescriptors();
         for (OptionDescriptor option : options) {
             if (option.getName().equals(name)) {
                 option.getOptionValue().setValue(convertValue(value));
--- a/mx.graal/mx_graal.py	Mon Aug 03 10:45:40 2015 -0700
+++ b/mx.graal/mx_graal.py	Tue Aug 04 01:09:31 2015 +0200
@@ -30,6 +30,7 @@
 import sanitycheck
 import itertools
 import json
+import re
 
 import mx
 import mx_jvmci
@@ -187,7 +188,9 @@
     args, vmargs = parser.parse_known_args(args)
 
     if args.ctwopts:
-        vmargs.append('-G:CompileTheWorldConfig=' + args.ctwopts)
+        # Replace spaces  with '#' since -G: options cannot contain spaces
+        # when they are collated in the "jvmci.options" system property
+        vmargs.append('-G:CompileTheWorldConfig=' + re.sub(r'\s+', '#', args.ctwopts))
 
     if args.jar:
         jar = os.path.abspath(args.jar)
--- a/mx.graal/suite.py	Mon Aug 03 10:45:40 2015 -0700
+++ b/mx.graal/suite.py	Tue Aug 04 01:09:31 2015 +0200
@@ -6,7 +6,7 @@
     "suites": [
             {
                "name" : "jvmci",
-               "version" : "528eeeca785ef0ed43138966bc0a301707fbf5d7",
+               "version" : "4f6caa445b9210031c03cae77ba9ece31d0e4943",
                "urls" : [
                     {"url" : "http://lafo.ssw.uni-linz.ac.at/hg/graal-jvmci-8", "kind" : "hg"},
                     {"url" : "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots", "kind" : "binary"},