changeset 22438:dfd506f2ed61

Add comment to jvmci.properties file.
author Roland Schatz <roland.schatz@oracle.com>
date Thu, 20 Aug 2015 15:15:05 +0200
parents c88c31c60755
children 4a7f09688c7b
files mx.jvmci/mx_jvmci.py src/share/vm/jvmci/jvmciRuntime.cpp
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mx.jvmci/mx_jvmci.py	Thu Aug 20 14:59:10 2015 +0200
+++ b/mx.jvmci/mx_jvmci.py	Thu Aug 20 15:15:05 2015 +0200
@@ -624,10 +624,14 @@
 
 def _updateJVMCIProperties(jdkDir, compilers):
     jvmciProperties = join(jdkDir, 'jre', 'lib', 'jvmci', 'jvmci.properties')
-    if not exists(jvmciProperties):
+    def createFile(compilers):
         with open(jvmciProperties, 'w') as fp:
+            print >> fp, "# the first entry wins, reorder entries to change the default compiler"
             for compiler in compilers:
                 print >> fp, "jvmci.compiler=" + compiler
+
+    if not exists(jvmciProperties):
+        createFile(compilers)
     else:
         oldCompilers = []
         with open(jvmciProperties) as fp:
@@ -641,12 +645,8 @@
                 changed = True
                 newCompilers += [c]
         if changed:
-            with open(jvmciProperties, 'w') as fp:
-                # prepend new compilers, since the first property wins
-                for c in newCompilers:
-                    print >> fp, "jvmci.compiler=" + c
-                for c in oldCompilers:
-                    print >> fp, "jvmci.compiler=" + c
+            # prepend new compilers, since the first property wins
+            createFile(newCompilers + oldCompilers)
 
 def _installDistInJdks(deployableDist):
     """
--- a/src/share/vm/jvmci/jvmciRuntime.cpp	Thu Aug 20 14:59:10 2015 +0200
+++ b/src/share/vm/jvmci/jvmciRuntime.cpp	Thu Aug 20 15:15:05 2015 +0200
@@ -758,6 +758,7 @@
  * The line must match the regular expression "[^=]+=.*". That is one or more
  * characters other than '=' followed by '=' followed by zero or more characters.
  * Everything before the '=' is the property name and everything after '=' is the value.
+ * Lines that start with '#' are treated as comments and ignored.
  * No special processing of whitespace or any escape characters is performed.
  * Also, no check is made whether an existing property is overridden.
  */
@@ -766,6 +767,10 @@
 public:
   JVMCIPropertiesFileClosure(SystemProperty** plist) : _plist(plist) {}
   void do_line(char* line) {
+    if (line[0] == '#') {
+      // skip comment
+      return;
+    }
     size_t len = strlen(line);
     char* sep = strchr(line, '=');
     if (sep == NULL) {