# HG changeset patch # User Roland Schatz # Date 1440076505 -7200 # Node ID dfd506f2ed618442764fee29f4d639c0c5367303 # Parent c88c31c6075596c6f1971c2b6e30ea97b040c637 Add comment to jvmci.properties file. diff -r c88c31c60755 -r dfd506f2ed61 mx.jvmci/mx_jvmci.py --- 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): """ diff -r c88c31c60755 -r dfd506f2ed61 src/share/vm/jvmci/jvmciRuntime.cpp --- 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) {