Generated compiler command file overrides user specified compiler command file

Aleksey Shipilev aleksey.shipilev at oracle.com
Tue May 27 18:43:43 UTC 2014


Hi Nitsan,

On 05/27/2014 03:40 PM, Nitsan Wakart wrote:
> At present if a user sets the -XX:CompileCommandFile option it will be
> overriden by the generated hints file. A workaround is for the user to
> set the -XX:CompileCommand with all the commands they want but that is
> not very nice. I've added support for merging the user provided CompileCommandFile and
> the JMH generated one.

Yeah, we should merge -XX:CompileCommandFile, thanks for jumping on it.

> Open issues:
> 1. This leaves the question of behavior for the default
> ".hotspot_compiler" file open.

We should merge in .hotspot_compiler as well. May be done later.

> 2. The merge expects 0 or one CompileCommandFile to be specified by the
> user. Only the first file is merged. Others are ignored.

Merging the first file is OK, since Hotspot will normally ignore
multiple -XX:CCF.

> 3. When implementing I also realized that the current check for compiler
> hints compatibility is broken when a forked JVM is specified which is
> different than the runner JVM.

It is, however we can't easily check the forked VM for hints
compatibility without forking the try-out VM to get the VM version.
While it is doable, I think it is a low priority for now.

> Patch is attached.

Okay, comments:

 * Let's move the .hgignore out of the picture for now. We can push
Eclipse ignores as the separate changeset.

 * What's the reason hintsFile and hintsFile(String) are almost
identical? Can we merge them together? Also, RunnerTest.tempFileWithLine
is also similar. Should we introduce the utility method? Get that into
Utils.

 * Null-check for Options should be done in Runner constructor, if done
at all.

 * "// FIXME: check...": belongs at isHintCompatibleVM() only, try not
to duplicate the notes in the source code.

 * Please avoid "import static", it only introduces ambiguities for the
readers, with questionable improvement for a code size.

 * "compileCommandFile == null": parentheses over ternary operator
predicate is advised. Try to also fold the entire condition into the
CompilerHints.hintsFile(String).

Thanks,
-Aleksey.


More information about the jmh-dev mailing list