-XX:CompileOnly command: how should it look like?

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Oct 15 09:08:00 PDT 2012

Regarding CompileOnly flag, ',' does separate multiple compileonly
directives (see compilerOracle.cpp:729-750). From usability perspective,
when combined with wildcards it provies very concise and convenient
syntax to control compilation for testing/development purposes. The only
thing I'm missing is filtering by method signatures.

I see 2 options to proceed now:
 	a) just fix the bug I wrote about in the original letter (unless ','
works as a directive separator by accident :-))
	b) in addition, extend CompileOnly format to allow same filtering
granularity as in command file (CompilerOracle::parse_from_line).

I'm in favor of (b), but would like to hear your opinion.

Best regards,
Vladimir Ivanov

On 10/13/12 03:45, John Rose wrote:
> On Oct 12, 2012, at 4:00 PM, Vladimir Kozlov wrote:
>> From what I remember originally we only accepted format ("," on command line to separate method and " " in .hotspot_compiler file):
>> /c1/c2/c3,m
>> Then Tom added next format to match PrintCompilation output:
>> c1.c2.c3::m
> The original command form was three blank-separated fields, command classname methodname.
> We added ',' as an alias for ' ' (everywhere) to make it easy to pass CC options through various shells.  The parser turns ',' to ' ', then separates into fields.
> We also added support for '::' as Vladimir said, to allow cut-and-paste of PrintC output names.  Once again, the '::' turns into a field separator.
> The ',' does not mean "here is another part of a command", so CompileOnly=String.length,List.size is nonsense.
> Multiple commands are separated by newlines '\n'.  This is most obvious in the .hotspot_compiler file, but is also true on the command line, because multiple accumulating string options are also glued together with newline '\n'.  Thus, -XX:CompileCommand=foo -XX:CompileCommand=bar is the same as -XX:CompileCommand="foo${n}bar" where ${n} is a newline character.
> Here's the embedded comment from CompilerOracle::parse_from_line:
>     // Allow '.' to separate the class name from the method name.
>     // This is the preferred spelling of methods:
>     //      exclude java/lang/String.indexOf(I)I
>     // Allow ',' for spaces (eases command line quoting).
>     //      exclude,java/lang/String.indexOf
>     // For backward compatibility, allow space as separator also.
>     //      exclude java/lang/String indexOf
>     //      exclude,java/lang/String,indexOf
>     // For easy cut-and-paste of method names, allow VM output format
>     // as produced by Method::print_short_name:
>     //      exclude java.lang.String::indexOf
> (I admit it's kludgey stuff.)
> — John

More information about the hotspot-compiler-dev mailing list